projects
/
project
/
netifd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
76a6865
)
ensure that iface->proto_handler gets initialized
author
Felix Fietkau
<nbd@openwrt.org>
Wed, 26 Oct 2011 17:30:05 +0000
(19:30 +0200)
committer
Felix Fietkau
<nbd@openwrt.org>
Wed, 26 Oct 2011 17:30:05 +0000
(19:30 +0200)
proto.c
patch
|
blob
|
history
diff --git
a/proto.c
b/proto.c
index
bd3b09a
..
c51637f
100644
(file)
--- a/
proto.c
+++ b/
proto.c
@@
-160,9
+160,10
@@
proto_init_interface(struct interface *iface, struct blob_attr *attr)
const struct proto_handler *proto = iface->proto_handler;
struct interface_proto_state *state = NULL;
const struct proto_handler *proto = iface->proto_handler;
struct interface_proto_state *state = NULL;
- if (proto)
-
state = proto->attach(proto, iface, attr)
;
+ if (
!
proto)
+
proto = &no_proto
;
+ state = proto->attach(proto, iface, attr);
if (!state) {
state = no_proto.attach(&no_proto, iface, attr);
state->cb = invalid_proto_handler;
if (!state) {
state = no_proto.attach(&no_proto, iface, attr);
state->cb = invalid_proto_handler;
@@
-183,8
+184,10
@@
proto_attach_interface(struct interface *iface, const char *proto_name)
}
proto = get_proto_handler(proto_name);
}
proto = get_proto_handler(proto_name);
- if (!proto)
+ if (!proto)
{
interface_add_error(iface, "proto", "INVALID_PROTO", NULL, 0);
interface_add_error(iface, "proto", "INVALID_PROTO", NULL, 0);
+ proto = &no_proto;
+ }
iface->proto_handler = proto;
}
iface->proto_handler = proto;
}