add_dynamic: remove redundant code
authorSteven Barth <steven@midlink.org>
Tue, 29 Jul 2014 16:43:45 +0000 (18:43 +0200)
committerSteven Barth <steven@midlink.org>
Tue, 29 Jul 2014 16:43:45 +0000 (18:43 +0200)
device_config is unneeded since add_dynamic is used to create aliases
checking of setup state is unneeded because of race condition fixes

Signed-off-by: Steven Barth <steven@midlink.org>
ubus.c

diff --git a/ubus.c b/ubus.c
index bed1fa498ee0b19f5ed656e8605c17b1e0cf0052..2522cfae28a151a07de45479045dfb32c6914309 100644 (file)
--- a/ubus.c
+++ b/ubus.c
@@ -140,8 +140,6 @@ netifd_add_dynamic(struct ubus_context *ctx, struct ubus_object *obj,
        if (!iface)
                return UBUS_STATUS_UNKNOWN_ERROR;
 
-       iface->device_config = true;
-
        config = blob_memdup(msg);
        if (!config)
                goto error;
@@ -161,11 +159,6 @@ netifd_add_dynamic(struct ubus_context *ctx, struct ubus_object *obj,
        if (!dev || !dev->default_config)
                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: