1 From: Felix Fietkau <nbd@nbd.name>
2 Date: Tue, 12 Feb 2019 14:22:43 +0100
3 Subject: [PATCH v2] wpa_supplicant: fix race condition in mesh mpm new peer
6 When wpa_supplicant receives another new peer event before the first one
7 has been processed, it tries to add a station to the driver a second time
8 (which fails) and then tears down the station entry until another event
10 Fix this by only adding a station to the driver if it didn't exist already.
12 Signed-off-by: Felix Fietkau <nbd@nbd.name>
15 --- a/wpa_supplicant/mesh_mpm.c
16 +++ b/wpa_supplicant/mesh_mpm.c
17 @@ -663,11 +663,12 @@ static struct sta_info * mesh_mpm_add_pe
20 sta = ap_get_sta(data, addr);
22 - sta = ap_sta_add(data, addr);
29 + sta = ap_sta_add(data, addr);
33 /* Set WMM by default since Mesh STAs are QoS STAs */
34 sta->flags |= WLAN_STA_WMM;