hostapd: fix passing radio parameter in wpa_supplicant calls
authorFelix Fietkau <nbd@nbd.name>
Thu, 19 Dec 2024 05:26:59 +0000 (06:26 +0100)
committerFelix Fietkau <nbd@nbd.name>
Thu, 19 Dec 2024 08:02:36 +0000 (09:02 +0100)
Fixes accessing PHY status in AP+STA configurations

Signed-off-by: Felix Fietkau <nbd@nbd.name>
(cherry picked from commit 8943430b9f8046d49842de6b40f9c90fb57fff04)

package/network/services/hostapd/files/hostapd.uc

index 2d9ce2874901d22b172244ad1bfb1f0f9a90fe3a..8e70f6b8afe6feeb14a53a207aa3b04f3b4a506d 100644 (file)
@@ -186,7 +186,7 @@ function __iface_pending_next(pending, state, ret, data)
 
                pending.call("wpa_supplicant", "phy_status", {
                        phy: phydev.phy,
-                       radio: phydev.radio,
+                       radio: phydev.radio ?? -1,
                });
                return "check_phy";
        case "check_phy":
@@ -199,7 +199,7 @@ function __iface_pending_next(pending, state, ret, data)
                }
                pending.call("wpa_supplicant", "phy_set_state", {
                        phy: phydev.phy,
-                       radio: phydev.radio,
+                       radio: phydev.radio ?? -1,
                        stop: true
                });
                return "wpas_stopped";
@@ -208,7 +208,7 @@ function __iface_pending_next(pending, state, ret, data)
                        hostapd.printf(`hostapd.add_iface failed for phy ${phy} ifname=${bss.ifname}`);
                pending.call("wpa_supplicant", "phy_set_state", {
                        phy: phydev.phy,
-                       radio: phydev.radio,
+                       radio: phydev.radio ?? -1,
                        stop: false
                });
                return null;