From 002fcaf065d93bb2221ba94284a254d64403f511 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Thu, 1 Oct 2026 08:39:46 +0200 Subject: [PATCH] wifi-scripts: let netifd alone add WDS station interfaces to the bridge Commit da4be02fcd5d ("hostapd: fix a race condition on adding AP mode wds sta interfaces") made netifd the only process that adds WDS station interfaces to the bridge. Its hostapd patch 711 copies bridge into wds_bridge when it parses bridge= and wds_bridge is still empty, and hostapd.sh writes an empty wds_bridge= after bridge=. ap.uc does not write the empty wds_bridge=, so hostapd adds each WDS station interface to the bridge, and netifd adds it again. The commit above names the effects of the race: incomplete bridge vlan settings, or a client that hostapd refuses. Write an empty wds_bridge= for a BSS with a bridge, as hostapd.sh does. The line must follow bridge=, because patch 711 fills an empty wds_bridge at parse time; append_vars() writes bridge first. A wds_bridge that the config sets for a wds BSS still applies, as in mac80211.sh. The previous change makes netifd link WDS station interfaces that appeared while it had no data for their vif. Signed-off-by: Felix Fietkau --- .../wifi-scripts/files-ucode/usr/share/ucode/wifi/ap.uc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/ap.uc b/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/ap.uc index a1f9b45e6d4..c738f591f67 100644 --- a/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/ap.uc +++ b/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/ap.uc @@ -39,6 +39,11 @@ function iface_setup(config, phy, num_global_macaddr, macaddr_base) { else config.wds_sta = true; + /* hostapd copies bridge= into an empty wds_bridge, so wds_bridge= must + * follow bridge= in append_vars() */ + if (config.bridge) + set_default(config, 'wds_bridge', ''); + if (!config.idx) append('interface', config.ifname); else