mark hotplug-added devices as external
authorFelix Fietkau <nbd@openwrt.org>
Tue, 1 Nov 2011 21:54:42 +0000 (22:54 +0100)
committerFelix Fietkau <nbd@openwrt.org>
Tue, 1 Nov 2011 21:54:42 +0000 (22:54 +0100)
ubus.c

diff --git a/ubus.c b/ubus.c
index c729c5d3a40a2be09cbe32fd2550452540dc6889..ce82a520c94417263b4d44fb179e7090dce4d809 100644 (file)
--- a/ubus.c
+++ b/ubus.c
@@ -302,7 +302,7 @@ netifd_iface_handle_device(struct ubus_context *ctx, struct ubus_object *obj,
        } else
                main_dev = iface->main_dev.dev;
 
-       dev = device_get(blobmsg_data(tb[DEV_NAME]), add);
+       dev = device_get(blobmsg_data(tb[DEV_NAME]), add ? 2 : 0);
        if (!dev && (main_dev || add)) {
                ret = UBUS_STATUS_NOT_FOUND;
                goto out;