hostapd: add patch for setting 4addr mode in multi_ap
authorRaphaël Mélotte <raphael.melotte@mind.be>
Tue, 9 Feb 2021 06:54:10 +0000 (07:54 +0100)
committerDaniel Golle <daniel@makrotopia.org>
Sat, 13 Feb 2021 13:44:22 +0000 (13:44 +0000)
This patch is required to be able to roam from one backhaul AP to
another one in the same ESS.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
(daniel@makrotopia.org: PKG_REVISION bump and refreshed patches)
Signed-off-by: Raphaël Mélotte <raphael.melotte@mind.be>
package/network/services/hostapd/Makefile
package/network/services/hostapd/patches/110-notify-mgmt-frames.patch
package/network/services/hostapd/patches/120-reconfigure-wps-credentials.patch
package/network/services/hostapd/patches/130-wpa_supplicant-multi_ap_roam.patch [new file with mode: 0644]
package/network/services/hostapd/patches/200-multicall.patch
package/network/services/hostapd/patches/370-ap_sta_support.patch
package/network/services/hostapd/patches/801-P2P-Fix-copying-of-secondary-device-types-for-P2P-gr.patch

index 6ab97c6e925d13ea1a69af8c1f0e636f0990192d..62f74923f01db1cc476a4a10a18c51a344c2516b 100644 (file)
@@ -7,7 +7,7 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=hostapd
-PKG_RELEASE:=30
+PKG_RELEASE:=31
 
 PKG_SOURCE_URL:=http://w1.fi/hostap.git
 PKG_SOURCE_PROTO:=git
index 9466b3dab6811586904d6b2aef3c3e1b0ebb3562..9e187253d4ccd290784c2871af8b366dff9dfd6f 100644 (file)
@@ -26,24 +26,20 @@ Signed-off-by: Raphaël Mélotte <raphael.melotte@mind.be>
  src/common/wpa_ctrl.h |  3 +++
  5 files changed, 36 insertions(+)
 
-diff --git a/hostapd/config_file.c b/hostapd/config_file.c
-index e09e6e141..6b88ecd17 100644
 --- a/hostapd/config_file.c
 +++ b/hostapd/config_file.c
-@@ -4323,6 +4323,8 @@ static int hostapd_config_fill(struct hostapd_config *conf,
+@@ -4456,6 +4456,8 @@ static int hostapd_config_fill(struct ho
                bss->multicast_to_unicast = atoi(pos);
        } else if (os_strcmp(buf, "broadcast_deauth") == 0) {
                bss->broadcast_deauth = atoi(pos);
 +      } else if (os_strcmp(buf, "notify_mgmt_frames") == 0) {
 +              conf->notify_mgmt_frames = atoi(pos);
  #ifdef CONFIG_DPP
-       } else if (os_strcmp(buf, "dpp_connector") == 0) {
-               os_free(bss->dpp_connector);
-diff --git a/hostapd/hostapd.conf b/hostapd/hostapd.conf
-index ce3ecdddf..28dcd4f57 100644
+       } else if (os_strcmp(buf, "dpp_name") == 0) {
+               os_free(bss->dpp_name);
 --- a/hostapd/hostapd.conf
 +++ b/hostapd/hostapd.conf
-@@ -550,6 +550,10 @@ wmm_ac_vo_acm=0
+@@ -571,6 +571,10 @@ wmm_ac_vo_acm=0
  # Default: 1 (enabled)
  #broadcast_deauth=1
  
@@ -54,11 +50,9 @@ index ce3ecdddf..28dcd4f57 100644
  ##### IEEE 802.11n related configuration ######################################
  
  # ieee80211n: Whether IEEE 802.11n (HT) is enabled
-diff --git a/src/ap/ap_config.h b/src/ap/ap_config.h
-index ea581a822..2f89d6ab9 100644
 --- a/src/ap/ap_config.h
 +++ b/src/ap/ap_config.h
-@@ -1008,6 +1008,8 @@ struct hostapd_config {
+@@ -1060,6 +1060,8 @@ struct hostapd_config {
        unsigned int airtime_update_interval;
  #define AIRTIME_MODE_MAX (__AIRTIME_MODE_MAX - 1)
  #endif /* CONFIG_AIRTIME_POLICY */
@@ -67,11 +61,9 @@ index ea581a822..2f89d6ab9 100644
  };
  
  
-diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c
-index c85a28db4..fc1291024 100644
 --- a/src/ap/ieee802_11.c
 +++ b/src/ap/ieee802_11.c
-@@ -4591,6 +4591,28 @@ static int handle_action(struct hostapd_data *hapd,
+@@ -4878,6 +4878,28 @@ static int handle_action(struct hostapd_
        return 1;
  }
  
@@ -100,7 +92,7 @@ index c85a28db4..fc1291024 100644
  
  /**
   * ieee802_11_mgmt - process incoming IEEE 802.11 management frames
-@@ -4665,6 +4687,9 @@ int ieee802_11_mgmt(struct hostapd_data *hapd, const u8 *buf, size_t len,
+@@ -4969,6 +4991,9 @@ int ieee802_11_mgmt(struct hostapd_data
        if (hapd->iconf->track_sta_max_num)
                sta_track_add(hapd->iface, mgmt->sa, ssi_signal);
  
@@ -110,13 +102,11 @@ index c85a28db4..fc1291024 100644
        switch (stype) {
        case WLAN_FC_STYPE_AUTH:
                wpa_printf(MSG_DEBUG, "mgmt::auth");
-diff --git a/src/common/wpa_ctrl.h b/src/common/wpa_ctrl.h
-index b24ae63e5..eeff9fcaa 100644
 --- a/src/common/wpa_ctrl.h
 +++ b/src/common/wpa_ctrl.h
-@@ -375,6 +375,9 @@ extern "C" {
- #define WDS_STA_INTERFACE_ADDED "WDS-STA-INTERFACE-ADDED "
- #define WDS_STA_INTERFACE_REMOVED "WDS-STA-INTERFACE-REMOVED "
+@@ -396,6 +396,9 @@ extern "C" {
+ #define BIT(x) (1U << (x))
+ #endif
  
 +/* Event triggered for received management frame */
 +#define AP_MGMT_FRAME_RECEIVED "AP-MGMT-FRAME-RECEIVED "
@@ -124,6 +114,3 @@ index b24ae63e5..eeff9fcaa 100644
  /* BSS command information masks */
  
  #define WPA_BSS_MASK_ALL              0xFFFDFFFF
--- 
-2.28.0
-
index d9489aab367db9f61d6e5255d958489b322dbc96..1826b6685b2e5a044dc9d71c2edb7757ca048ff1 100644 (file)
@@ -19,11 +19,9 @@ Signed-off-by: Raphaël Mélotte <raphael.melotte@mind.be>
  src/wps/wps_registrar.c | 29 ++++++++++++++
  3 files changed, 118 insertions(+), 3 deletions(-)
 
-diff --git a/src/ap/wps_hostapd.c b/src/ap/wps_hostapd.c
-index dc8aa8f65..ff942a67b 100644
 --- a/src/ap/wps_hostapd.c
 +++ b/src/ap/wps_hostapd.c
-@@ -1375,6 +1375,43 @@ static void hostapd_wps_nfc_clear(struct wps_context *wps)
+@@ -1375,6 +1375,43 @@ static void hostapd_wps_nfc_clear(struct
  #endif /* CONFIG_WPS_NFC */
  }
  
@@ -67,7 +65,7 @@ index dc8aa8f65..ff942a67b 100644
  
  void hostapd_deinit_wps(struct hostapd_data *hapd)
  {
-@@ -1409,11 +1446,54 @@ void hostapd_update_wps(struct hostapd_data *hapd)
+@@ -1409,11 +1446,54 @@ void hostapd_update_wps(struct hostapd_d
        hapd->wps->upc = hapd->conf->upc;
  #endif /* CONFIG_WPS_UPNP */
  
@@ -125,11 +123,9 @@ index dc8aa8f65..ff942a67b 100644
        else
                hostapd_deinit_wps(hapd);
  }
-diff --git a/src/wps/wps.h b/src/wps/wps.h
-index 93888b011..110e3ea52 100644
 --- a/src/wps/wps.h
 +++ b/src/wps/wps.h
-@@ -938,6 +938,12 @@ struct wpabuf * wps_build_nfc_handover_sel_p2p(struct wps_context *ctx,
+@@ -938,6 +938,12 @@ struct wpabuf * wps_build_nfc_handover_s
                                               struct wpabuf *nfc_dh_pubkey,
                                               struct wpabuf *nfc_dev_pw);
  
@@ -142,11 +138,9 @@ index 93888b011..110e3ea52 100644
  /* ndef.c */
  struct wpabuf * ndef_parse_wifi(const struct wpabuf *buf);
  struct wpabuf * ndef_build_wifi(const struct wpabuf *buf);
-diff --git a/src/wps/wps_registrar.c b/src/wps/wps_registrar.c
-index 9e1ee36da..d6b27be28 100644
 --- a/src/wps/wps_registrar.c
 +++ b/src/wps/wps_registrar.c
-@@ -3669,6 +3669,35 @@ int wps_registrar_config_ap(struct wps_registrar *reg,
+@@ -3669,6 +3669,35 @@ int wps_registrar_config_ap(struct wps_r
  }
  
  
@@ -182,6 +176,3 @@ index 9e1ee36da..d6b27be28 100644
  #ifdef CONFIG_WPS_NFC
  
  int wps_registrar_add_nfc_pw_token(struct wps_registrar *reg,
--- 
-2.29.2
-
diff --git a/package/network/services/hostapd/patches/130-wpa_supplicant-multi_ap_roam.patch b/package/network/services/hostapd/patches/130-wpa_supplicant-multi_ap_roam.patch
new file mode 100644 (file)
index 0000000..fd3017a
--- /dev/null
@@ -0,0 +1,37 @@
+From 8a4893dd06eb236460db4937f3c54e246739ad28 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Rapha=C3=ABl=20M=C3=A9lotte?= <raphael.melotte@mind.be>
+Date: Wed, 3 Feb 2021 14:23:17 +0100
+Subject: [PATCH] wpa_supplicant: multi_ap: only enable 4addr mode if not
+ already enabled
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+If 4addr mode is already enabled, the call to enable it a second time
+may fail. If this happens when roaming, it leads to deauthentication.
+
+Signed-off-by: Raphaël Mélotte <raphael.melotte@mind.be>
+---
+ wpa_supplicant/events.c | 10 ++++++----
+ 1 file changed, 6 insertions(+), 4 deletions(-)
+
+--- a/wpa_supplicant/events.c
++++ b/wpa_supplicant/events.c
+@@ -2589,11 +2589,13 @@ static void multi_ap_set_4addr_mode(stru
+               goto fail;
+       }
+-      if (wpa_drv_set_4addr_mode(wpa_s, 1) < 0) {
+-              wpa_printf(MSG_ERROR, "Failed to set 4addr mode");
+-              goto fail;
++      if (wpa_s->enabled_4addr_mode == 0) {
++              if (wpa_drv_set_4addr_mode(wpa_s, 1) < 0) {
++                      wpa_printf(MSG_ERROR, "Failed to set 4addr mode");
++                      goto fail;
++              }
++              wpa_s->enabled_4addr_mode = 1;
+       }
+-      wpa_s->enabled_4addr_mode = 1;
+       return;
+ fail:
index 9119a24c552f4edfac3cd19e236ad287a0d9fe51..4f3e3decfe3365947f6c641b5816c9f646621f98 100644 (file)
        os_memset(&global, 0, sizeof(global));
 --- a/wpa_supplicant/events.c
 +++ b/wpa_supplicant/events.c
-@@ -4579,8 +4579,8 @@ static void wpas_event_unprot_beacon(str
+@@ -4581,8 +4581,8 @@ static void wpas_event_unprot_beacon(str
  }
  
  
  {
        struct wpa_supplicant *wpa_s = ctx;
        int resched;
-@@ -5398,7 +5398,7 @@ void wpa_supplicant_event(void *ctx, enu
+@@ -5400,7 +5400,7 @@ void wpa_supplicant_event(void *ctx, enu
  }
  
  
index 1c5f72ddc0fd44f9083e2721c9283ab2347e1c91..a7a646d2d1b4211194bad042b7d69945fa0475ce 100644 (file)
        if (ieee802_11_build_ap_params(hapd, &params) < 0)
 --- a/wpa_supplicant/events.c
 +++ b/wpa_supplicant/events.c
-@@ -4579,6 +4579,60 @@ static void wpas_event_unprot_beacon(str
+@@ -4581,6 +4581,60 @@ static void wpas_event_unprot_beacon(str
  }
  
  
  void supplicant_event(void *ctx, enum wpa_event_type event,
                      union wpa_event_data *data)
  {
-@@ -4881,8 +4935,10 @@ void supplicant_event(void *ctx, enum wp
+@@ -4883,8 +4937,10 @@ void supplicant_event(void *ctx, enum wp
                        channel_width_to_string(data->ch_switch.ch_width),
                        data->ch_switch.cf1,
                        data->ch_switch.cf2);
index 4657b55d857a829411de95b0558d0e094a445fbd..944f7d71c9503c4fcb7debcc0748c3cb7c9a8a8e 100644 (file)
@@ -20,11 +20,9 @@ Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
  src/p2p/p2p.c | 2 ++
  1 file changed, 2 insertions(+)
 
-diff --git a/src/p2p/p2p.c b/src/p2p/p2p.c
-index 74b7b52ae05c..5cbfc217fc1f 100644
 --- a/src/p2p/p2p.c
 +++ b/src/p2p/p2p.c
-@@ -453,6 +453,8 @@ static void p2p_copy_client_info(struct p2p_device *dev,
+@@ -453,6 +453,8 @@ static void p2p_copy_client_info(struct
        dev->info.config_methods = cli->config_methods;
        os_memcpy(dev->info.pri_dev_type, cli->pri_dev_type, 8);
        dev->info.wps_sec_dev_type_list_len = 8 * cli->num_sec_dev_types;
@@ -33,6 +31,3 @@ index 74b7b52ae05c..5cbfc217fc1f 100644
        os_memcpy(dev->info.wps_sec_dev_type_list, cli->sec_dev_types,
                  dev->info.wps_sec_dev_type_list_len);
  }
--- 
-2.25.1
-