summaryrefslogtreecommitdiff
path: root/ubus.c
diff options
context:
space:
mode:
authorSteven Barth <steven@midlink.org>2014-07-25 00:01:50 +0200
committerSteven Barth <steven@midlink.org>2014-07-25 00:01:50 +0200
commite46cbd2f89f0be8e4a2423c065cf6b2e6ebcfea3 (patch)
treee47060fe038f413767c8fd7fcfc825031d9f0283 /ubus.c
parent4156ba83483d0f1203fd17159974ae958325368c (diff)
downloadnetifd-e46cbd2f89f0be8e4a2423c065cf6b2e6ebcfea3.tar.gz
Only add dynamic interfaces if the underlying interface is ready
Signed-off-by: Steven Barth <steven@midlink.org>
Diffstat (limited to 'ubus.c')
-rw-r--r--ubus.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/ubus.c b/ubus.c
index 9a573c6..6c42aa1 100644
--- 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: