wireless: fix handling config reload with reconf=1
authorFelix Fietkau <nbd@nbd.name>
Wed, 28 Jun 2023 12:35:46 +0000 (14:35 +0200)
committerFelix Fietkau <nbd@nbd.name>
Wed, 28 Jun 2023 12:35:57 +0000 (14:35 +0200)
If reload triggers while the wdev is up, and reconf is set to 1, run the
setup handler immediately, otherwise the change will not be applied.

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

index 3590cb7d453d44fe592aa97dfb0eb321fb68846d..58f096d05311a05077a30356d958953b0a32aa0f 100644 (file)
@@ -680,10 +680,15 @@ wdev_set_config_state(struct wireless_device *wdev, enum interface_config_state
        if (wdev->config_state != IFC_NORMAL)
                return;
 
+       if (s == IFC_RELOAD && wdev->reconf && wdev->state == IFS_UP) {
+               wireless_device_reconf(wdev);
+               return;
+       }
+
        wdev->config_state = s;
        if (wdev->state == IFS_DOWN)
                wdev_handle_config_change(wdev);
-       else if (!wdev->reconf || wdev->state != IFS_UP)
+       else
                __wireless_device_set_down(wdev);
 }