wireless: add back regular virtual interfaces on hotplug-add events as well
authorFelix Fietkau <nbd@nbd.name>
Fri, 23 Jul 2021 09:37:57 +0000 (11:37 +0200)
committerFelix Fietkau <nbd@nbd.name>
Fri, 23 Jul 2021 09:38:00 +0000 (11:38 +0200)
When hostapd does a DFS channel switch, it tears down all vifs except for the
primary one, which causes them got get dropped from the device configuration

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

index 0c4930c68ec634e3b301a8c43c9d1e77340407c8..a8fd9dd09295fc5d4315ac6ba1922be05e82e3db 100644 (file)
@@ -1506,13 +1506,16 @@ void wireless_device_hotplug_event(const char *name, bool add)
        int len;
 
        s = strstr(name, ".sta");
-       if (!s)
-               return;
+       if (s) {
+               if (strchr(s + 4, '.'))
+                       return;
 
-       if (strchr(s + 4, '.'))
+               len = s - name;
+       } else if (!device_find(name)) {
+               len = strlen(name);
+       } else {
                return;
-
-       len = s - name;
+       }
 
        vlist_for_each_element(&wireless_devices, wdev, node) {
                vlist_for_each_element(&wdev->interfaces, vif, node) {