2019-02-12 13:26:04 +00:00
|
|
|
From: Felix Fietkau <nbd@nbd.name>
|
|
|
|
Date: Tue, 12 Feb 2019 14:22:43 +0100
|
2019-02-17 15:04:08 +00:00
|
|
|
Subject: [PATCH v2] wpa_supplicant: fix race condition in mesh mpm new peer
|
2019-02-12 13:26:04 +00:00
|
|
|
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)
|
2019-02-17 15:04:08 +00:00
|
|
|
+ return NULL;
|
2019-02-12 13:26:04 +00:00
|
|
|
+
|
|
|
|
+ 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;
|