From: Felix Fietkau Date: Thu, 12 Jul 2012 21:20:38 +0000 (+0200) Subject: ensure hotplug devices are marked as present in the add path - they are not cleaned... X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=f096d021fb4119a449a7980e1667c2033491dba7;p=oweals%2Fnetifd.git ensure hotplug devices are marked as present in the add path - they are not cleaned up if they have config settings attached to them --- diff --git a/ubus.c b/ubus.c index 742cc43..0f19607 100644 --- 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();