diff options
author | Steven Barth <steven@midlink.org> | 2013-10-17 16:49:23 +0200 |
---|---|---|
committer | Steven Barth <steven@midlink.org> | 2013-10-17 16:49:23 +0200 |
commit | 266d92dd83bd5bfe520f3e2838794bf9bb827c07 (patch) | |
tree | a448f29345b00f855a5a194e98e965e96afcb1cf /interface.c | |
parent | 45e9c1a9a4df8580a9c1117c225d5e9ec73694c4 (diff) | |
download | netifd-266d92dd83bd5bfe520f3e2838794bf9bb827c07.tar.gz |
Add ubus function to create nested interfaces
Diffstat (limited to 'interface.c')
-rw-r--r-- | interface.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/interface.c b/interface.c index ddbdca9..49fc830 100644 --- a/interface.c +++ b/interface.c @@ -220,6 +220,9 @@ __interface_set_down(struct interface *iface, bool force) interface_proto_event(iface->proto, PROTO_CMD_TEARDOWN, force); if (force) interface_flush_state(iface); + + if (iface->dynamic) + vlist_delete(&interfaces, &iface->node); } static void @@ -530,7 +533,7 @@ void interface_set_proto_state(struct interface *iface, struct interface_proto_s void interface_init(struct interface *iface, const char *name, - struct blob_attr *config) + struct blob_attr *config, bool dynamic) { struct blob_attr *tb[IFACE_ATTR_MAX]; struct blob_attr *cur; @@ -600,6 +603,10 @@ interface_init(struct interface *iface, const char *name, } iface->config_autostart = iface->autostart; + iface->dynamic = dynamic; + + if (iface->dynamic) + iface->node.version = -1; // Don't delete on reload } static bool __interface_add(struct interface *iface, struct blob_attr *config, bool alias) |