dda1fa58943a3c140d0bf89516a6a118803efe56
[openwrt/staging/xback.git] /
1 From 23dc11dfbd8e78a2450120e9afc83c1d32a8e683 Mon Sep 17 00:00:00 2001
2 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
3 Date: Mon, 12 Sep 2016 19:02:34 +0200
4 Subject: [PATCH] Revert "nl80211: Remove duplicated check in
5 nl80211_setup_ap()"
6 MIME-Version: 1.0
7 Content-Type: text/plain; charset=UTF-8
8 Content-Transfer-Encoding: 8bit
9
10 This reverts commit 647862eb60c324015ea31293cc052558b5185ca4.
11
12 The second check of device_ap_sme looks like duplicated, but it isn't
13 actually. The trick is nl80211_create_monitor_interface may change that
14 variable value and the second evaluation may give a different result.
15
16 This definitely isn't a very clear code, but that change caused a
17 regression for drivers that:
18 1) Don't report NL80211_ATTR_DEVICE_AP_SME
19 2) Don't support monitor mode
20 3) Don't support subscribing for PROBE_REQ and/or ACTION frames
21 like brcmfmac. With such drivers hostapd doesn't start anymore.
22
23 Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
24 ---
25 src/drivers/driver_nl80211.c | 3 ++-
26 1 file changed, 2 insertions(+), 1 deletion(-)
27
28 --- a/src/drivers/driver_nl80211.c
29 +++ b/src/drivers/driver_nl80211.c
30 @@ -4434,7 +4434,8 @@ static int nl80211_setup_ap(struct i802_
31 "nl80211: Failed to subscribe for mgmt frames from SME driver - trying to run without it");
32
33 if (!drv->device_ap_sme && drv->use_monitor &&
34 - nl80211_create_monitor_interface(drv))
35 + nl80211_create_monitor_interface(drv) &&
36 + !drv->device_ap_sme)
37 return -1;
38
39 if (drv->device_ap_sme &&