From e46cbd2f89f0be8e4a2423c065cf6b2e6ebcfea3 Mon Sep 17 00:00:00 2001 From: Steven Barth Date: Fri, 25 Jul 2014 00:01:50 +0200 Subject: [PATCH] Only add dynamic interfaces if the underlying interface is ready Signed-off-by: Steven Barth --- ubus.c | 4 ++++ 1 file changed, 4 insertions(+) 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: -- 2.11.0