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 9a573c6019bfcf15fad4158ea7460c1a813f7a5b..6c42aa133b34d89bf9982615b65625a15749f31d 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: