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 05:44:48 +0000 (06:44 +0100)
Fixes accessing PHY status in AP+STA configurations

Signed-off-by: Felix Fietkau <nbd@nbd.name>
package/network/services/hostapd/files/hostapd.uc

index e345a678f417c3a88c1b355a33533bb7dc47d950..873881200ad26f095971fb096bdf9b1a39afc1d3 100644 (file)
@@ -189,7 +189,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":
@@ -202,7 +202,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";
@@ -211,7 +211,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;