From: Rafał Miłecki Date: Tue, 13 Sep 2016 10:05:33 +0000 (+0200) Subject: hostapd: fix regression breaking brcmfmac X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=e70e3c544ae4649b1eae0d13ac09aa6b2e734bf4;p=openwrt%2Fstaging%2Fthess.git hostapd: fix regression breaking brcmfmac The latest update of hostapd broke brcmfmac due to upstream regression. Signed-off-by: Rafał Miłecki --- diff --git a/package/network/services/hostapd/patches/130-Revert-nl80211-Remove-duplicated-check-in-nl80211_se.patch b/package/network/services/hostapd/patches/130-Revert-nl80211-Remove-duplicated-check-in-nl80211_se.patch new file mode 100644 index 0000000000..dda1fa5894 --- /dev/null +++ b/package/network/services/hostapd/patches/130-Revert-nl80211-Remove-duplicated-check-in-nl80211_se.patch @@ -0,0 +1,39 @@ +From 23dc11dfbd8e78a2450120e9afc83c1d32a8e683 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +Date: Mon, 12 Sep 2016 19:02:34 +0200 +Subject: [PATCH] Revert "nl80211: Remove duplicated check in + nl80211_setup_ap()" +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +This reverts commit 647862eb60c324015ea31293cc052558b5185ca4. + +The second check of device_ap_sme looks like duplicated, but it isn't +actually. The trick is nl80211_create_monitor_interface may change that +variable value and the second evaluation may give a different result. + +This definitely isn't a very clear code, but that change caused a +regression for drivers that: +1) Don't report NL80211_ATTR_DEVICE_AP_SME +2) Don't support monitor mode +3) Don't support subscribing for PROBE_REQ and/or ACTION frames +like brcmfmac. With such drivers hostapd doesn't start anymore. + +Signed-off-by: Rafał Miłecki +--- + src/drivers/driver_nl80211.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/src/drivers/driver_nl80211.c ++++ b/src/drivers/driver_nl80211.c +@@ -4434,7 +4434,8 @@ static int nl80211_setup_ap(struct i802_ + "nl80211: Failed to subscribe for mgmt frames from SME driver - trying to run without it"); + + if (!drv->device_ap_sme && drv->use_monitor && +- nl80211_create_monitor_interface(drv)) ++ nl80211_create_monitor_interface(drv) && ++ !drv->device_ap_sme) + return -1; + + if (drv->device_ap_sme && diff --git a/package/network/services/hostapd/patches/350-nl80211_del_beacon_bss.patch b/package/network/services/hostapd/patches/350-nl80211_del_beacon_bss.patch index 0409cca9e8..3a0820313e 100644 --- a/package/network/services/hostapd/patches/350-nl80211_del_beacon_bss.patch +++ b/package/network/services/hostapd/patches/350-nl80211_del_beacon_bss.patch @@ -31,7 +31,7 @@ if (drv->eapol_sock >= 0) { eloop_unregister_read_sock(drv->eapol_sock); -@@ -4462,8 +4467,7 @@ static void nl80211_teardown_ap(struct i +@@ -4463,8 +4468,7 @@ static void nl80211_teardown_ap(struct i nl80211_remove_monitor_interface(drv); else nl80211_mgmt_unsubscribe(bss, "AP teardown"); @@ -41,7 +41,7 @@ } -@@ -6472,8 +6476,6 @@ static int wpa_driver_nl80211_if_remove( +@@ -6473,8 +6477,6 @@ static int wpa_driver_nl80211_if_remove( } else { wpa_printf(MSG_DEBUG, "nl80211: First BSS - reassign context"); nl80211_teardown_ap(bss); @@ -50,7 +50,7 @@ nl80211_destroy_bss(bss); if (!bss->added_if) i802_set_iface_flags(bss, 0); -@@ -6835,8 +6837,7 @@ static int wpa_driver_nl80211_deinit_ap( +@@ -6836,8 +6838,7 @@ static int wpa_driver_nl80211_deinit_ap( struct wpa_driver_nl80211_data *drv = bss->drv; if (!is_ap_interface(drv->nlmode)) return -1; @@ -60,7 +60,7 @@ /* * If the P2P GO interface was dynamically added, then it is -@@ -6855,8 +6856,7 @@ static int wpa_driver_nl80211_stop_ap(vo +@@ -6856,8 +6857,7 @@ static int wpa_driver_nl80211_stop_ap(vo struct wpa_driver_nl80211_data *drv = bss->drv; if (!is_ap_interface(drv->nlmode)) return -1; diff --git a/package/network/services/hostapd/patches/461-driver_nl80211-use-new-parameters-during-ibss-join.patch b/package/network/services/hostapd/patches/461-driver_nl80211-use-new-parameters-during-ibss-join.patch index 24bf8d3f79..591543b89c 100644 --- a/package/network/services/hostapd/patches/461-driver_nl80211-use-new-parameters-during-ibss-join.patch +++ b/package/network/services/hostapd/patches/461-driver_nl80211-use-new-parameters-during-ibss-join.patch @@ -10,7 +10,7 @@ Signed-hostap: Antonio Quartulli --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c -@@ -4721,7 +4721,7 @@ static int wpa_driver_nl80211_ibss(struc +@@ -4722,7 +4722,7 @@ static int wpa_driver_nl80211_ibss(struc struct wpa_driver_associate_params *params) { struct nl_msg *msg; @@ -19,7 +19,7 @@ Signed-hostap: Antonio Quartulli int count = 0; wpa_printf(MSG_DEBUG, "nl80211: Join IBSS (ifindex=%d)", drv->ifindex); -@@ -4748,6 +4748,37 @@ retry: +@@ -4749,6 +4749,37 @@ retry: nl80211_put_beacon_int(msg, params->beacon_int)) goto fail; diff --git a/package/network/services/hostapd/patches/462-wpa_s-support-htmode-param.patch b/package/network/services/hostapd/patches/462-wpa_s-support-htmode-param.patch index 88b23fb3bd..993b6de0b5 100644 --- a/package/network/services/hostapd/patches/462-wpa_s-support-htmode-param.patch +++ b/package/network/services/hostapd/patches/462-wpa_s-support-htmode-param.patch @@ -27,7 +27,7 @@ Signed-off-by: Antonio Quartulli * bssid_hint - BSSID of a proposed AP --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c -@@ -4779,6 +4779,22 @@ retry: +@@ -4780,6 +4780,22 @@ retry: nla_put_u32(msg, NL80211_ATTR_MCAST_RATE, params->mcast_rate); }