From 17e453bd68b41780b6564dafa8358efc29a00930 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Fri, 23 Jul 2021 11:37:57 +0200 Subject: wireless: add back regular virtual interfaces on hotplug-add events as well 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 --- wireless.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/wireless.c b/wireless.c index 0c4930c..a8fd9dd 100644 --- a/wireless.c +++ b/wireless.c @@ -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) { -- cgit v1.2.1