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
7 Content-Type: text/plain; charset=UTF-8
8 Content-Transfer-Encoding: 8bit
10 This reverts commit 647862eb60c324015ea31293cc052558b5185ca4.
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.
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.
23 Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
25 src/drivers/driver_nl80211.c | 3 ++-
26 1 file changed, 2 insertions(+), 1 deletion(-)
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");
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)
39 if (drv->device_ap_sme &&