diff options
author | Felix Fietkau <nbd@openwrt.org> | 2011-04-13 21:16:14 +0200 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2011-04-13 21:16:14 +0200 |
commit | 71427e54fa17dacd1ace6077bffb9f9b9d456ebb (patch) | |
tree | 2fe7e2e23e91569bfc7bd9b0f6e117470ac9202f /interface.c | |
parent | 1f8dc227cdd425f1313f564fd074c614bb1954a3 (diff) |
add some infrastructure code for proto handlers
Diffstat (limited to 'interface.c')
-rw-r--r-- | interface.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/interface.c b/interface.c index 06a36ed..ef176f6 100644 --- a/interface.c +++ b/interface.c @@ -175,7 +175,7 @@ void interface_set_proto_state(struct interface *iface, struct interface_proto_s } struct interface * -alloc_interface(const char *name) +alloc_interface(const char *name, struct uci_section *s) { struct interface *iface; @@ -184,19 +184,14 @@ alloc_interface(const char *name) return iface; iface = calloc(1, sizeof(*iface)); - - interface_set_proto_state(iface, get_default_proto()); - if (!iface->proto) { - free(iface); - return NULL; - } - iface->main_dev.cb = interface_cb; iface->l3_iface = &iface->main_dev; strncpy(iface->name, name, sizeof(iface->name) - 1); list_add(&iface->list, &interfaces); INIT_LIST_HEAD(&iface->errors); + proto_attach_interface(iface, s); + netifd_ubus_add_interface(iface); return iface; |