From: Felix Fietkau Date: Mon, 23 Nov 2020 11:11:42 +0000 (+0100) Subject: system-linux: implement full device present state management for force-external devices X-Git-Url: http://git.openwrt.org/?a=commitdiff_plain;h=213748a9bcd9683778250e3673b70acdcc8d96a2;p=project%2Fnetifd.git system-linux: implement full device present state management for force-external devices We need to detect when devices are present, because they can be created asynchronously by hostapd after they have already been added by the wifi setup script Signed-off-by: Felix Fietkau --- diff --git a/system-linux.c b/system-linux.c index 78455ae..7ca4c8b 100644 --- a/system-linux.c +++ b/system-linux.c @@ -597,7 +597,7 @@ static int cb_rtnl_event(struct nl_msg *msg, void *arg) if (!system_get_dev_sysctl("/sys/class/net/%s/carrier", dev->ifname, buf, sizeof(buf))) link_state = strtoul(buf, NULL, 0); - if (dev->type == &simple_device_type && !system_if_force_external(dev->ifname)) + if (dev->type == &simple_device_type) device_set_present(dev, true); device_set_link(dev, link_state ? true : false); @@ -679,9 +679,6 @@ found: if (dev->type != &simple_device_type) return; - if (add && system_if_force_external(dev->ifname)) - return; - device_set_present(dev, add); }