ensure hotplug devices are marked as present in the add path - they are not cleaned...
authorFelix Fietkau <nbd@openwrt.org>
Thu, 12 Jul 2012 21:20:38 +0000 (23:20 +0200)
committerFelix Fietkau <nbd@openwrt.org>
Thu, 12 Jul 2012 21:22:24 +0000 (23:22 +0200)
ubus.c

diff --git a/ubus.c b/ubus.c
index 742cc432751b79069a993291801a1c400e279fff..0f19607fecdb8714b4388b119007dc77dff5df3e 100644 (file)
--- a/ubus.c
+++ b/ubus.c
@@ -562,10 +562,12 @@ netifd_iface_handle_device(struct ubus_context *ctx, struct ubus_object *obj,
        if (add && !dev)
                return UBUS_STATUS_NOT_FOUND;
 
-       if (add)
+       if (add) {
+               device_set_present(dev, true);
                ret = interface_add_link(iface, dev);
-       else
+       } else {
                ret = interface_remove_link(iface, dev);
+       }
 
        device_unlock();