]>
Commit | Line | Data |
---|---|---|
92379080 EQ |
1 | From: Felix Fietkau <nbd@nbd.name> |
2 | Date: Wed, 20 Oct 2021 21:13:10 +0200 | |
3 | Subject: [PATCH] hostpad: fix a race condition on adding AP mode wds sta | |
4 | interfaces | |
5 | ||
6 | Both hostapd and netifd attempt to add a VLAN device to a bridge. | |
7 | Depending on which one wins the race, bridge vlan settings might be incomplete, | |
8 | or hostapd might run into an error and refuse to service the client. | |
9 | Fix this by preventing hostapd from adding interfaces to the bridge and | |
10 | instead rely entirely on netifd handling this properly | |
11 | ||
da4be02f FF |
12 | --- a/hostapd/config_file.c |
13 | +++ b/hostapd/config_file.c | |
24d0e746 | 14 | @@ -2447,6 +2447,8 @@ static int hostapd_config_fill(struct ho |
da4be02f FF |
15 | sizeof(conf->bss[0]->iface)); |
16 | } else if (os_strcmp(buf, "bridge") == 0) { | |
17 | os_strlcpy(bss->bridge, pos, sizeof(bss->bridge)); | |
18 | + if (!bss->wds_bridge[0]) | |
19 | + os_strlcpy(bss->wds_bridge, pos, sizeof(bss->wds_bridge)); | |
304423a4 NH |
20 | } else if (os_strcmp(buf, "bridge_hairpin") == 0) { |
21 | bss->bridge_hairpin = atoi(pos); | |
da4be02f FF |
22 | } else if (os_strcmp(buf, "vlan_bridge") == 0) { |
23 | --- a/src/ap/ap_drv_ops.c | |
24 | +++ b/src/ap/ap_drv_ops.c | |
24d0e746 | 25 | @@ -387,8 +387,6 @@ int hostapd_set_wds_sta(struct hostapd_d |
da4be02f FF |
26 | return -1; |
27 | if (hapd->conf->wds_bridge[0]) | |
28 | bridge = hapd->conf->wds_bridge; | |
29 | - else if (hapd->conf->bridge[0]) | |
30 | - bridge = hapd->conf->bridge; | |
31 | return hapd->driver->set_wds_sta(hapd->drv_priv, addr, aid, val, | |
32 | bridge, ifname_wds); | |
33 | } |