Only add dynamic interfaces if the underlying interface is ready
authorSteven Barth <steven@midlink.org>
Thu, 24 Jul 2014 22:01:50 +0000 (00:01 +0200)
committerSteven Barth <steven@midlink.org>
Thu, 24 Jul 2014 22:01:50 +0000 (00:01 +0200)
Signed-off-by: Steven Barth <steven@midlink.org>
ubus.c

diff --git a/ubus.c b/ubus.c
index 9a573c6..6c42aa1 100644 (file)
--- a/ubus.c
+++ b/ubus.c
@@ -162,6 +162,10 @@ netifd_add_dynamic(struct ubus_context *ctx, struct ubus_object *obj,
                return UBUS_STATUS_UNKNOWN_ERROR;
 
        device_set_config(dev, dev->type, msg);
+
+       if (iface->state != IFS_SETUP && iface->state != IFS_UP)
+               vlist_delete(&interfaces, &iface->node);
+
        return UBUS_STATUS_OK;
 
 error: