interface: do not force link-ext hotplug interfaces to present by default
authorFelix Fietkau <nbd@nbd.name>
Fri, 20 Nov 2020 12:49:00 +0000 (13:49 +0100)
committerFelix Fietkau <nbd@nbd.name>
Fri, 20 Nov 2020 12:49:42 +0000 (13:49 +0100)
On wireless interfaces, hostapd can sometimes defer the bringup of secondary
virtual interfaces until autochannel or coex scan completes.
Do not force the present state in that case in order to avoid attempting
to bring up the device before it is ready

Signed-off-by: Felix Fietkau <nbd@nbd.name>
interface.c

index c53c091c32325c13e61a70caa628e15699e5871a..ccae915ef27ebaa597db24b5c0dcb8abdc22bf51 100644 (file)
@@ -1081,7 +1081,8 @@ interface_handle_link(struct interface *iface, const char *name,
 
        if (add) {
                interface_set_device_config(iface, dev);
-               device_set_present(dev, true);
+               if (!link_ext)
+                       device_set_present(dev, true);
 
                ret = interface_add_link(iface, dev, vlan, link_ext);
        } else {