fd3017af92229fac182a149cb52897005f3bb676
[openwrt/openwrt.git] / package / network / services / hostapd / patches / 130-wpa_supplicant-multi_ap_roam.patch
1 From 8a4893dd06eb236460db4937f3c54e246739ad28 Mon Sep 17 00:00:00 2001
2 From: =?UTF-8?q?Rapha=C3=ABl=20M=C3=A9lotte?= <raphael.melotte@mind.be>
3 Date: Wed, 3 Feb 2021 14:23:17 +0100
4 Subject: [PATCH] wpa_supplicant: multi_ap: only enable 4addr mode if not
5 already enabled
6 MIME-Version: 1.0
7 Content-Type: text/plain; charset=UTF-8
8 Content-Transfer-Encoding: 8bit
9
10 If 4addr mode is already enabled, the call to enable it a second time
11 may fail. If this happens when roaming, it leads to deauthentication.
12
13 Signed-off-by: Raphaël Mélotte <raphael.melotte@mind.be>
14 ---
15 wpa_supplicant/events.c | 10 ++++++----
16 1 file changed, 6 insertions(+), 4 deletions(-)
17
18 --- a/wpa_supplicant/events.c
19 +++ b/wpa_supplicant/events.c
20 @@ -2589,11 +2589,13 @@ static void multi_ap_set_4addr_mode(stru
21 goto fail;
22 }
23
24 - if (wpa_drv_set_4addr_mode(wpa_s, 1) < 0) {
25 - wpa_printf(MSG_ERROR, "Failed to set 4addr mode");
26 - goto fail;
27 + if (wpa_s->enabled_4addr_mode == 0) {
28 + if (wpa_drv_set_4addr_mode(wpa_s, 1) < 0) {
29 + wpa_printf(MSG_ERROR, "Failed to set 4addr mode");
30 + goto fail;
31 + }
32 + wpa_s->enabled_4addr_mode = 1;
33 }
34 - wpa_s->enabled_4addr_mode = 1;
35 return;
36
37 fail: