system-linux: implement full device present state management for force-external devices
authorFelix Fietkau <nbd@nbd.name>
Mon, 23 Nov 2020 11:11:42 +0000 (12:11 +0100)
committerFelix Fietkau <nbd@nbd.name>
Mon, 23 Nov 2020 11:48:53 +0000 (12:48 +0100)
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 <nbd@nbd.name>
system-linux.c

index 78455aeab38d4a97161b11ec910275b050568dea..7ca4c8b612953a8abecd9ce1836bfe5ce2ca8d40 100644 (file)
@@ -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);
 }