hostapd: fix regression breaking brcmfmac
authorRafał Miłecki <rafal@milecki.pl>
Tue, 13 Sep 2016 10:05:33 +0000 (12:05 +0200)
committerRafał Miłecki <rafal@milecki.pl>
Tue, 13 Sep 2016 10:06:42 +0000 (12:06 +0200)
The latest update of hostapd broke brcmfmac due to upstream regression.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
package/network/services/hostapd/patches/130-Revert-nl80211-Remove-duplicated-check-in-nl80211_se.patch [new file with mode: 0644]
package/network/services/hostapd/patches/350-nl80211_del_beacon_bss.patch
package/network/services/hostapd/patches/461-driver_nl80211-use-new-parameters-during-ibss-join.patch
package/network/services/hostapd/patches/462-wpa_s-support-htmode-param.patch

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 (file)
index 0000000..dda1fa5
--- /dev/null
@@ -0,0 +1,39 @@
+From 23dc11dfbd8e78a2450120e9afc83c1d32a8e683 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
+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 <rafal@milecki.pl>
+---
+ 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 &&
index 0409cca9e85193c30cc07a093392250cd915415f..3a0820313e46121572858af0f3b608ba902bcba5 100644 (file)
@@ -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;
index 24bf8d3f79bc542f654814c93abbbda483e02253..591543b89ccddf9a23bb42182289bf1e5d9e5cf1 100644 (file)
@@ -10,7 +10,7 @@ Signed-hostap: Antonio Quartulli <ordex@autistici.org>
 
 --- 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 <ordex@autistici.org>
        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;
  
index 88b23fb3bdf5e9e94645bf01342f2342d9addd62..993b6de0b5ae317f1a16b021b63608f6e9eb4ba6 100644 (file)
@@ -27,7 +27,7 @@ Signed-off-by: Antonio Quartulli <ordex@autistici.org>
         * 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);
        }