mirror of
https://github.com/openwrt/openwrt.git
synced 2024-12-20 22:23:27 +00:00
hostapd: fix a race condition on adding AP mode wds sta interfaces
Both hostapd and netifd attempt to add a VLAN device to a bridge. Depending on which one wins the race, bridge vlan settings might be incomplete, or hostapd might run into an error and refuse to service the client. Fix this by preventing hostapd from adding interfaces to the bridge and instead rely entirely on netifd handling this properly Signed-off-by: Felix Fietkau <nbd@nbd.name> (cherry-picked from commitda4be02fcd
) (cherry-picked from commit63c01ad025
)
This commit is contained in:
parent
d9373c5922
commit
9b660c63ad
@ -729,7 +729,7 @@ hostapd_set_bss_options() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
append bss_conf "ssid=$ssid" "$N"
|
append bss_conf "ssid=$ssid" "$N"
|
||||||
[ -n "$network_bridge" ] && append bss_conf "bridge=$network_bridge" "$N"
|
[ -n "$network_bridge" ] && append bss_conf "bridge=$network_bridge${N}wds_bridge=" "$N"
|
||||||
[ -n "$network_ifname" ] && append bss_conf "snoop_iface=$network_ifname" "$N"
|
[ -n "$network_ifname" ] && append bss_conf "snoop_iface=$network_ifname" "$N"
|
||||||
[ -n "$iapp_interface" ] && {
|
[ -n "$iapp_interface" ] && {
|
||||||
local ifname
|
local ifname
|
||||||
|
@ -0,0 +1,22 @@
|
|||||||
|
--- a/hostapd/config_file.c
|
||||||
|
+++ b/hostapd/config_file.c
|
||||||
|
@@ -2357,6 +2357,8 @@ static int hostapd_config_fill(struct ho
|
||||||
|
sizeof(conf->bss[0]->iface));
|
||||||
|
} else if (os_strcmp(buf, "bridge") == 0) {
|
||||||
|
os_strlcpy(bss->bridge, pos, sizeof(bss->bridge));
|
||||||
|
+ if (!bss->wds_bridge[0])
|
||||||
|
+ os_strlcpy(bss->wds_bridge, pos, sizeof(bss->wds_bridge));
|
||||||
|
} else if (os_strcmp(buf, "vlan_bridge") == 0) {
|
||||||
|
os_strlcpy(bss->vlan_bridge, pos, sizeof(bss->vlan_bridge));
|
||||||
|
} else if (os_strcmp(buf, "wds_bridge") == 0) {
|
||||||
|
--- a/src/ap/ap_drv_ops.c
|
||||||
|
+++ b/src/ap/ap_drv_ops.c
|
||||||
|
@@ -340,8 +340,6 @@ int hostapd_set_wds_sta(struct hostapd_d
|
||||||
|
return -1;
|
||||||
|
if (hapd->conf->wds_bridge[0])
|
||||||
|
bridge = hapd->conf->wds_bridge;
|
||||||
|
- else if (hapd->conf->bridge[0])
|
||||||
|
- bridge = hapd->conf->bridge;
|
||||||
|
return hapd->driver->set_wds_sta(hapd->drv_priv, addr, aid, val,
|
||||||
|
bridge, ifname_wds);
|
||||||
|
}
|
@ -55,10 +55,10 @@
|
|||||||
"x_snoop: Failed to initialize L2 packet processing %s",
|
"x_snoop: Failed to initialize L2 packet processing %s",
|
||||||
--- a/hostapd/config_file.c
|
--- a/hostapd/config_file.c
|
||||||
+++ b/hostapd/config_file.c
|
+++ b/hostapd/config_file.c
|
||||||
@@ -2357,6 +2357,8 @@ static int hostapd_config_fill(struct ho
|
@@ -2359,6 +2359,8 @@ static int hostapd_config_fill(struct ho
|
||||||
sizeof(conf->bss[0]->iface));
|
|
||||||
} else if (os_strcmp(buf, "bridge") == 0) {
|
|
||||||
os_strlcpy(bss->bridge, pos, sizeof(bss->bridge));
|
os_strlcpy(bss->bridge, pos, sizeof(bss->bridge));
|
||||||
|
if (!bss->wds_bridge[0])
|
||||||
|
os_strlcpy(bss->wds_bridge, pos, sizeof(bss->wds_bridge));
|
||||||
+ } else if (os_strcmp(buf, "snoop_iface") == 0) {
|
+ } else if (os_strcmp(buf, "snoop_iface") == 0) {
|
||||||
+ os_strlcpy(bss->snoop_iface, pos, sizeof(bss->snoop_iface));
|
+ os_strlcpy(bss->snoop_iface, pos, sizeof(bss->snoop_iface));
|
||||||
} else if (os_strcmp(buf, "vlan_bridge") == 0) {
|
} else if (os_strcmp(buf, "vlan_bridge") == 0) {
|
||||||
|
Loading…
Reference in New Issue
Block a user