diff options
author | Felix Fietkau <nbd@openwrt.org> | 2011-09-07 14:37:18 +0200 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2011-09-07 14:37:18 +0200 |
commit | 69b2dcb92b8402b9c6df4d6a041a890fe6468e18 (patch) | |
tree | c0acc6b30947ac7c8499d6d2f402abf837c9008c /interface.c | |
parent | 3fa53680c85a6e029a3e7b4d673bffee4795fa52 (diff) |
add code for versioned lists and use it to manage addresses and routes
Diffstat (limited to 'interface.c')
-rw-r--r-- | interface.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/interface.c b/interface.c index 387d349..031959c 100644 --- a/interface.c +++ b/interface.c @@ -89,8 +89,8 @@ interface_event(struct interface *iface, enum interface_event ev) static void mark_interface_down(struct interface *iface) { - interface_del_all_routes(iface); - interface_del_ctx_addr(iface, NULL); + vlist_flush_all(&iface->proto_addr); + vlist_flush_all(&iface->proto_route); device_release(&iface->main_dev); iface->state = IFS_DOWN; } @@ -129,8 +129,6 @@ __interface_set_down(struct interface *iface, bool force) iface->state = IFS_TEARDOWN; interface_event(iface, IFEV_DOWN); - - interface_del_all_routes(iface); interface_proto_event(iface->proto, PROTO_CMD_TEARDOWN, force); } @@ -221,8 +219,8 @@ interface_alloc(const char *name, struct blob_attr *attr) strncpy(iface->name, name, sizeof(iface->name) - 1); list_add_tail(&iface->list, &interfaces); INIT_LIST_HEAD(&iface->errors); - INIT_LIST_HEAD(&iface->address); - INIT_LIST_HEAD(&iface->routes); + + interface_ip_init(iface); blobmsg_parse(iface_attrs, IFACE_ATTR_MAX, tb, blob_data(attr), blob_len(attr)); |