aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@nbd.name>2019-02-12 14:26:04 +0100
committerFelix Fietkau <nbd@nbd.name>2019-02-12 15:12:35 +0100
commitdb93949aa395198bbd647827a1f8220e78fbaf3e (patch)
tree3a2aed86e1b04508fb5f2e6291accd636ae39cc3
parent6a15077e2d7fa850ef5e49275cb7b62e36a6ab2c (diff)
downloadupstream-db93949aa395198bbd647827a1f8220e78fbaf3e.tar.gz
upstream-db93949aa395198bbd647827a1f8220e78fbaf3e.tar.bz2
upstream-db93949aa395198bbd647827a1f8220e78fbaf3e.zip
hostapd: fix race condition in mesh new peer handling
Avoid trying to add the same station to the driver multiple times Signed-off-by: Felix Fietkau <nbd@nbd.name>
-rw-r--r--package/network/services/hostapd/patches/051-wpa_supplicant-fix-race-condition-in-mesh-mpm-new-pe.patch34
1 files changed, 34 insertions, 0 deletions
diff --git a/package/network/services/hostapd/patches/051-wpa_supplicant-fix-race-condition-in-mesh-mpm-new-pe.patch b/package/network/services/hostapd/patches/051-wpa_supplicant-fix-race-condition-in-mesh-mpm-new-pe.patch
new file mode 100644
index 0000000000..b5bd7b0a68
--- /dev/null
+++ b/package/network/services/hostapd/patches/051-wpa_supplicant-fix-race-condition-in-mesh-mpm-new-pe.patch
@@ -0,0 +1,34 @@
+From: Felix Fietkau <nbd@nbd.name>
+Date: Tue, 12 Feb 2019 14:22:43 +0100
+Subject: [PATCH] wpa_supplicant: fix race condition in mesh mpm new peer
+ handling
+
+When wpa_supplicant receives another new peer event before the first one
+has been processed, it tries to add a station to the driver a second time
+(which fails) and then tears down the station entry until another event
+comes in.
+Fix this by only adding a station to the driver if it didn't exist already.
+
+Signed-off-by: Felix Fietkau <nbd@nbd.name>
+---
+
+--- a/wpa_supplicant/mesh_mpm.c
++++ b/wpa_supplicant/mesh_mpm.c
+@@ -663,11 +663,12 @@ static struct sta_info * mesh_mpm_add_pe
+ }
+
+ sta = ap_get_sta(data, addr);
+- if (!sta) {
+- sta = ap_sta_add(data, addr);
+- if (!sta)
+- return NULL;
+- }
++ if (sta)
++ return sta;
++
++ sta = ap_sta_add(data, addr);
++ if (!sta)
++ return NULL;
+
+ /* Set WMM by default since Mesh STAs are QoS STAs */
+ sta->flags |= WLAN_STA_WMM;