projects
/
project
/
netifd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
do not attempt to get an interface if PROTO_FLAG_NODEV is set
[project/netifd.git]
/
proto.c
diff --git
a/proto.c
b/proto.c
index 278fb0c33e736789765d4e1d4c602d66774fe641..d8f16b33e2e45c9f5003e5c9670920edf0157e3b 100644
(file)
--- a/
proto.c
+++ b/
proto.c
@@
-48,14
+48,14
@@
default_proto_attach(const struct proto_handler *h,
proto = calloc(1, sizeof(*proto));
proto->free = default_proto_free;
proto = calloc(1, sizeof(*proto));
proto->free = default_proto_free;
- proto->flags = PROTO_FLAG_IMMEDIATE;
- proto->handler = no_proto_handler;
+ proto->cb = no_proto_handler;
return proto;
}
static const struct proto_handler no_proto = {
.name = "none",
return proto;
}
static const struct proto_handler no_proto = {
.name = "none",
+ .flags = PROTO_FLAG_IMMEDIATE,
.attach = default_proto_attach,
};
.attach = default_proto_attach,
};
@@
-84,9
+84,10
@@
proto_init_interface(struct interface *iface, struct blob_attr *attr)
if (!state) {
state = no_proto.attach(&no_proto, iface, attr);
if (!state) {
state = no_proto.attach(&no_proto, iface, attr);
- state->
handler
= invalid_proto_handler;
+ state->
cb
= invalid_proto_handler;
}
}
+ state->handler = proto;
interface_set_proto_state(iface, state);
}
interface_set_proto_state(iface, state);
}
@@
-114,8
+115,8
@@
interface_proto_event(struct interface_proto_state *proto,
enum interface_event ev;
int ret;
enum interface_event ev;
int ret;
- ret = proto->
handler
(proto, cmd, force);
- if (ret || !(proto->flags & PROTO_FLAG_IMMEDIATE))
+ ret = proto->
cb
(proto, cmd, force);
+ if (ret || !(proto->
handler->
flags & PROTO_FLAG_IMMEDIATE))
goto out;
switch(cmd) {
goto out;
switch(cmd) {