From 6e0fa4a76db667d7f0c1d84a3af5017df26d3fad Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Sat, 12 May 2018 21:08:18 +0200 Subject: [PATCH] hostapd: fix mesh+AP Fix encrypted (or DFS) AP+MESH interface combination in a way similar to how it's done for AP+STA and fix netifd shell script. Refresh patches while at it. Signed-off-by: Daniel Golle --- package/network/services/hostapd/Makefile | 2 +- .../network/services/hostapd/files/hostapd.sh | 6 +- ...20-mesh-properly-handle-sae_password.patch | 9 +- ...21-mesh-make-forwarding-configurable.patch | 45 +--- .../030-rsn_supp-fix-stub-pmksa_cache.patch | 6 +- ...CHANWIDTH_USE_HT-to-max_oper_chwidth.patch | 13 +- ...ent-use-of-VHT20-config-in-mesh-mode.patch | 21 +- .../hostapd/patches/200-multicall.patch | 10 +- .../services/hostapd/patches/300-noscan.patch | 2 +- .../hostapd/patches/301-mesh-noscan.patch | 30 +-- .../patches/310-rescan_immediately.patch | 2 +- .../hostapd/patches/370-ap_sta_support.patch | 231 +++++++++--------- ...dd-new-config-params-to-be-used-with.patch | 6 +- .../patches/463-add-mcast_rate-to-11s.patch | 6 +- .../patches/464-fix-mesh-obss-check.patch | 2 +- 15 files changed, 171 insertions(+), 220 deletions(-) diff --git a/package/network/services/hostapd/Makefile b/package/network/services/hostapd/Makefile index fef0fa8e57..0adb7c9ef7 100644 --- a/package/network/services/hostapd/Makefile +++ b/package/network/services/hostapd/Makefile @@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=hostapd -PKG_RELEASE:=3 +PKG_RELEASE:=4 PKG_SOURCE_URL:=http://w1.fi/hostap.git PKG_SOURCE_PROTO:=git diff --git a/package/network/services/hostapd/files/hostapd.sh b/package/network/services/hostapd/files/hostapd.sh index 5065978f3c..520da5b159 100644 --- a/package/network/services/hostapd/files/hostapd.sh +++ b/package/network/services/hostapd/files/hostapd.sh @@ -674,7 +674,7 @@ wpa_supplicant_add_network() { [[ "$_w_mode" = "adhoc" ]] && { append network_data "mode=1" "$N$T" - [ -n "$channel" ] && wpa_supplicant_set_fixed_freq "$freq" "$htmode" + [ -n "$freq" ] && wpa_supplicant_set_fixed_freq "$freq" "$htmode" scan_ssid="scan_ssid=0" @@ -683,11 +683,11 @@ wpa_supplicant_add_network() { [[ "$_w_mode" = "mesh" ]] && { json_get_vars mesh_id mesh_fwding - ssid="${mesh_id}" + [ -n "$mesh_id" ] && ssid="${mesh_id}" append network_data "mode=5" "$N$T" [ -n "$mesh_fwding" ] && append network_data "mesh_fwding=${mesh_fwding}" "$N$T" - [ -n "$channel" ] && wpa_supplicant_set_fixed_freq "$freq" "$htmode" + [ -n "$freq" ] && wpa_supplicant_set_fixed_freq "$freq" "$htmode" [ "$noscan" = "1" ] && append network_data "noscan=1" "$N$T" append wpa_key_mgmt "SAE" scan_ssid="" diff --git a/package/network/services/hostapd/patches/020-mesh-properly-handle-sae_password.patch b/package/network/services/hostapd/patches/020-mesh-properly-handle-sae_password.patch index 17cc1e7383..775774bf64 100644 --- a/package/network/services/hostapd/patches/020-mesh-properly-handle-sae_password.patch +++ b/package/network/services/hostapd/patches/020-mesh-properly-handle-sae_password.patch @@ -20,11 +20,9 @@ Signed-off-by: Daniel Golle wpa_supplicant/mesh.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) -diff --git a/wpa_supplicant/mesh.c b/wpa_supplicant/mesh.c -index 22dec4822..0bf87245d 100644 --- a/wpa_supplicant/mesh.c +++ b/wpa_supplicant/mesh.c -@@ -154,10 +154,14 @@ int wpas_mesh_init_rsn(struct wpa_supplicant *wpa_s) +@@ -154,10 +154,14 @@ int wpas_mesh_init_rsn(struct wpa_suppli struct wpa_ssid *ssid = wpa_s->current_ssid; struct hostapd_data *bss = ifmsh->bss[0]; static int default_groups[] = { 19, 20, 21, 25, 26, -1 }; @@ -40,7 +38,7 @@ index 22dec4822..0bf87245d 100644 wpa_printf(MSG_ERROR, "mesh: Passphrase for SAE not configured"); return -1; -@@ -177,9 +181,9 @@ int wpas_mesh_init_rsn(struct wpa_supplicant *wpa_s) +@@ -177,9 +181,9 @@ int wpas_mesh_init_rsn(struct wpa_suppli return -1; } @@ -52,6 +50,3 @@ index 22dec4822..0bf87245d 100644 wpa_s->mesh_rsn = mesh_rsn_auth_init(wpa_s, mconf); if (!wpa_s->mesh_rsn) --- -2.17.0 - diff --git a/package/network/services/hostapd/patches/021-mesh-make-forwarding-configurable.patch b/package/network/services/hostapd/patches/021-mesh-make-forwarding-configurable.patch index c7e7ffde9e..13f0deaaf0 100644 --- a/package/network/services/hostapd/patches/021-mesh-make-forwarding-configurable.patch +++ b/package/network/services/hostapd/patches/021-mesh-make-forwarding-configurable.patch @@ -24,8 +24,6 @@ Signed-off-by: Daniel Golle wpa_supplicant/wpa_supplicant.conf | 6 ++++++ 10 files changed, 37 insertions(+), 2 deletions(-) -diff --git a/src/ap/ap_config.h b/src/ap/ap_config.h -index 03ab80d43..804385e93 100644 --- a/src/ap/ap_config.h +++ b/src/ap/ap_config.h @@ -49,6 +49,7 @@ struct mesh_conf { @@ -44,8 +42,6 @@ index 03ab80d43..804385e93 100644 u8 radio_measurements[RRM_CAPABILITIES_IE_LEN]; -diff --git a/src/drivers/driver.h b/src/drivers/driver.h -index 6c9245584..7f1ec3697 100644 --- a/src/drivers/driver.h +++ b/src/drivers/driver.h @@ -1363,6 +1363,7 @@ struct wpa_driver_mesh_bss_params { @@ -64,11 +60,9 @@ index 6c9245584..7f1ec3697 100644 u16 ht_opmode; }; -diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c -index e9cb4ae2f..f3de61886 100644 --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c -@@ -9197,6 +9197,9 @@ static int nl80211_put_mesh_config(struct nl_msg *msg, +@@ -9197,6 +9197,9 @@ static int nl80211_put_mesh_config(struc if (((params->flags & WPA_DRIVER_MESH_CONF_FLAG_AUTO_PLINKS) && nla_put_u8(msg, NL80211_MESHCONF_AUTO_OPEN_PLINKS, params->auto_plinks)) || @@ -78,11 +72,9 @@ index e9cb4ae2f..f3de61886 100644 ((params->flags & WPA_DRIVER_MESH_CONF_FLAG_MAX_PEER_LINKS) && nla_put_u16(msg, NL80211_MESHCONF_MAX_PEER_LINKS, params->max_peer_links)) || -diff --git a/wpa_supplicant/config.c b/wpa_supplicant/config.c -index a0b8cd007..0212e3f86 100644 --- a/wpa_supplicant/config.c +++ b/wpa_supplicant/config.c -@@ -2211,6 +2211,7 @@ static const struct parse_data ssid_fields[] = { +@@ -2211,6 +2211,7 @@ static const struct parse_data ssid_fiel #ifdef CONFIG_MESH { INT_RANGE(mode, 0, 5) }, { INT_RANGE(no_auto_peer, 0, 1) }, @@ -90,7 +82,7 @@ index a0b8cd007..0212e3f86 100644 { INT_RANGE(mesh_rssi_threshold, -255, 1) }, #else /* CONFIG_MESH */ { INT_RANGE(mode, 0, 4) }, -@@ -2757,6 +2758,7 @@ void wpa_config_set_network_defaults(struct wpa_ssid *ssid) +@@ -2757,6 +2758,7 @@ void wpa_config_set_network_defaults(str ssid->dot11MeshRetryTimeout = DEFAULT_MESH_RETRY_TIMEOUT; ssid->dot11MeshConfirmTimeout = DEFAULT_MESH_CONFIRM_TIMEOUT; ssid->dot11MeshHoldingTimeout = DEFAULT_MESH_HOLDING_TIMEOUT; @@ -98,7 +90,7 @@ index a0b8cd007..0212e3f86 100644 ssid->mesh_rssi_threshold = DEFAULT_MESH_RSSI_THRESHOLD; #endif /* CONFIG_MESH */ #ifdef CONFIG_HT_OVERRIDES -@@ -3886,6 +3888,7 @@ struct wpa_config * wpa_config_alloc_empty(const char *ctrl_interface, +@@ -3886,6 +3888,7 @@ struct wpa_config * wpa_config_alloc_emp config->user_mpm = DEFAULT_USER_MPM; config->max_peer_links = DEFAULT_MAX_PEER_LINKS; config->mesh_max_inactivity = DEFAULT_MESH_MAX_INACTIVITY; @@ -106,7 +98,7 @@ index a0b8cd007..0212e3f86 100644 config->dot11RSNASAERetransPeriod = DEFAULT_DOT11_RSNA_SAE_RETRANS_PERIOD; config->fast_reauth = DEFAULT_FAST_REAUTH; -@@ -4508,6 +4511,7 @@ static const struct global_parse_data global_fields[] = { +@@ -4508,6 +4511,7 @@ static const struct global_parse_data gl { INT(user_mpm), 0 }, { INT_RANGE(max_peer_links, 0, 255), 0 }, { INT(mesh_max_inactivity), 0 }, @@ -114,8 +106,6 @@ index a0b8cd007..0212e3f86 100644 { INT(dot11RSNASAERetransPeriod), 0 }, #endif /* CONFIG_MESH */ { INT(disable_scan_offload), 0 }, -diff --git a/wpa_supplicant/config.h b/wpa_supplicant/config.h -index 05c4f8fb9..491d8aa5c 100644 --- a/wpa_supplicant/config.h +++ b/wpa_supplicant/config.h @@ -18,6 +18,7 @@ @@ -135,11 +125,9 @@ index 05c4f8fb9..491d8aa5c 100644 /** * dot11RSNASAERetransPeriod - Timeout to retransmit SAE Auth frame * -diff --git a/wpa_supplicant/config_file.c b/wpa_supplicant/config_file.c -index 5a7186961..c4112b3ff 100644 --- a/wpa_supplicant/config_file.c +++ b/wpa_supplicant/config_file.c -@@ -816,6 +816,7 @@ static void wpa_config_write_network(FILE *f, struct wpa_ssid *ssid) +@@ -816,6 +816,7 @@ static void wpa_config_write_network(FIL #endif /* IEEE8021X_EAPOL */ INT(mode); INT(no_auto_peer); @@ -147,7 +135,7 @@ index 5a7186961..c4112b3ff 100644 INT(frequency); INT(fixed_freq); #ifdef CONFIG_ACS -@@ -1433,6 +1434,9 @@ static void wpa_config_write_global(FILE *f, struct wpa_config *config) +@@ -1433,6 +1434,9 @@ static void wpa_config_write_global(FILE fprintf(f, "mesh_max_inactivity=%d\n", config->mesh_max_inactivity); @@ -157,8 +145,6 @@ index 5a7186961..c4112b3ff 100644 if (config->dot11RSNASAERetransPeriod != DEFAULT_DOT11_RSNA_SAE_RETRANS_PERIOD) fprintf(f, "dot11RSNASAERetransPeriod=%d\n", -diff --git a/wpa_supplicant/config_ssid.h b/wpa_supplicant/config_ssid.h -index 87a45c435..24d1848e0 100644 --- a/wpa_supplicant/config_ssid.h +++ b/wpa_supplicant/config_ssid.h @@ -492,6 +492,11 @@ struct wpa_ssid { @@ -173,11 +159,9 @@ index 87a45c435..24d1848e0 100644 int ht; int ht40; -diff --git a/wpa_supplicant/mesh.c b/wpa_supplicant/mesh.c -index 3c2ee97da..22c10a015 100644 --- a/wpa_supplicant/mesh.c +++ b/wpa_supplicant/mesh.c -@@ -121,6 +121,7 @@ static struct mesh_conf * mesh_config_create(struct wpa_supplicant *wpa_s, +@@ -121,6 +121,7 @@ static struct mesh_conf * mesh_config_cr conf->mesh_cc_id = 0; conf->mesh_sp_id = MESH_SYNC_METHOD_NEIGHBOR_OFFSET; conf->mesh_auth_id = (conf->security & MESH_CONF_SEC_AUTH) ? 1 : 0; @@ -185,7 +169,7 @@ index 3c2ee97da..22c10a015 100644 conf->dot11MeshMaxRetries = ssid->dot11MeshMaxRetries; conf->dot11MeshRetryTimeout = ssid->dot11MeshRetryTimeout; conf->dot11MeshConfirmTimeout = ssid->dot11MeshConfirmTimeout; -@@ -254,6 +255,7 @@ static int wpa_supplicant_mesh_init(struct wpa_supplicant *wpa_s, +@@ -256,6 +257,7 @@ static int wpa_supplicant_mesh_init(stru bss->conf->start_disabled = 1; bss->conf->mesh = MESH_ENABLED; bss->conf->ap_max_inactivity = wpa_s->conf->mesh_max_inactivity; @@ -193,7 +177,7 @@ index 3c2ee97da..22c10a015 100644 if (ieee80211_is_dfs(ssid->frequency) && wpa_s->conf->country[0]) { conf->ieee80211h = 1; -@@ -506,6 +508,10 @@ int wpa_supplicant_join_mesh(struct wpa_supplicant *wpa_s, +@@ -508,6 +510,10 @@ int wpa_supplicant_join_mesh(struct wpa_ } params->conf.peer_link_timeout = wpa_s->conf->mesh_max_inactivity; @@ -204,11 +188,9 @@ index 3c2ee97da..22c10a015 100644 wpa_s->mesh_params = params; if (wpa_supplicant_mesh_init(wpa_s, ssid, ¶ms->freq)) { wpa_msg(wpa_s, MSG_ERROR, "Failed to init mesh"); -diff --git a/wpa_supplicant/mesh_mpm.c b/wpa_supplicant/mesh_mpm.c -index bc3cc5ef9..e7058e646 100644 --- a/wpa_supplicant/mesh_mpm.c +++ b/wpa_supplicant/mesh_mpm.c -@@ -288,9 +288,9 @@ static void mesh_mpm_send_plink_action(struct wpa_supplicant *wpa_s, +@@ -288,9 +288,9 @@ static void mesh_mpm_send_plink_action(s info = (bss->num_plinks > 63 ? 63 : bss->num_plinks) << 1; /* TODO: Add Connected to Mesh Gate/AS subfields */ wpabuf_put_u8(buf, info); @@ -220,8 +202,6 @@ index bc3cc5ef9..e7058e646 100644 } else { /* Peer closing frame */ /* IE: Mesh ID */ wpabuf_put_u8(buf, WLAN_EID_MESH_ID); -diff --git a/wpa_supplicant/wpa_supplicant.conf b/wpa_supplicant/wpa_supplicant.conf -index 972e7e73d..e1c475f37 100644 --- a/wpa_supplicant/wpa_supplicant.conf +++ b/wpa_supplicant/wpa_supplicant.conf @@ -153,6 +153,12 @@ ap_scan=1 @@ -237,6 +217,3 @@ index 972e7e73d..e1c475f37 100644 # cert_in_cb - Whether to include a peer certificate dump in events # This controls whether peer certificates for authentication server and # its certificate chain are included in EAP peer certificate events. This is --- -2.17.0 - diff --git a/package/network/services/hostapd/patches/030-rsn_supp-fix-stub-pmksa_cache.patch b/package/network/services/hostapd/patches/030-rsn_supp-fix-stub-pmksa_cache.patch index bd380765c6..db6ec04b35 100644 --- a/package/network/services/hostapd/patches/030-rsn_supp-fix-stub-pmksa_cache.patch +++ b/package/network/services/hostapd/patches/030-rsn_supp-fix-stub-pmksa_cache.patch @@ -1,8 +1,6 @@ -diff --git a/src/rsn_supp/pmksa_cache.h b/src/rsn_supp/pmksa_cache.h -index 626761dea..6c49fa924 100644 --- a/src/rsn_supp/pmksa_cache.h +++ b/src/rsn_supp/pmksa_cache.h -@@ -101,7 +101,7 @@ static inline void pmksa_cache_deinit(struct rsn_pmksa_cache *pmksa) +@@ -101,7 +101,7 @@ static inline void pmksa_cache_deinit(st static inline struct rsn_pmksa_cache_entry * pmksa_cache_get(struct rsn_pmksa_cache *pmksa, const u8 *aa, const u8 *pmkid, @@ -11,7 +9,7 @@ index 626761dea..6c49fa924 100644 { return NULL; } -@@ -148,7 +148,8 @@ static inline int pmksa_cache_set_current(struct wpa_sm *sm, const u8 *pmkid, +@@ -148,7 +148,8 @@ static inline int pmksa_cache_set_curren const u8 *bssid, void *network_ctx, int try_opportunistic, diff --git a/package/network/services/hostapd/patches/031-mesh-add-VHT_CHANWIDTH_USE_HT-to-max_oper_chwidth.patch b/package/network/services/hostapd/patches/031-mesh-add-VHT_CHANWIDTH_USE_HT-to-max_oper_chwidth.patch index 30003116e9..8ff11f3191 100644 --- a/package/network/services/hostapd/patches/031-mesh-add-VHT_CHANWIDTH_USE_HT-to-max_oper_chwidth.patch +++ b/package/network/services/hostapd/patches/031-mesh-add-VHT_CHANWIDTH_USE_HT-to-max_oper_chwidth.patch @@ -15,11 +15,9 @@ Signed-off-by: Peter Oh wpa_supplicant/wpa_supplicant.c | 3 +++ 3 files changed, 5 insertions(+) -diff --git a/wpa_supplicant/config.c b/wpa_supplicant/config.c -index f65bbb02f..7e8f014cc 100644 --- a/wpa_supplicant/config.c +++ b/wpa_supplicant/config.c -@@ -2798,6 +2798,7 @@ void wpa_config_set_network_defaults(struct wpa_ssid *ssid) +@@ -2796,6 +2796,7 @@ void wpa_config_set_network_defaults(str ssid->mka_priority = DEFAULT_PRIO_NOT_KEY_SERVER; #endif /* CONFIG_MACSEC */ ssid->mac_addr = -1; @@ -27,8 +25,6 @@ index f65bbb02f..7e8f014cc 100644 } -diff --git a/wpa_supplicant/config_ssid.h b/wpa_supplicant/config_ssid.h -index 9fd56c32f..2ddb777b2 100644 --- a/wpa_supplicant/config_ssid.h +++ b/wpa_supplicant/config_ssid.h @@ -37,6 +37,7 @@ @@ -39,11 +35,9 @@ index 9fd56c32f..2ddb777b2 100644 struct psk_list_entry { struct dl_list list; -diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c -index dcd787bec..ca893f942 100644 --- a/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c -@@ -2293,6 +2293,9 @@ void ibss_mesh_setup_freq(struct wpa_supplicant *wpa_s, +@@ -2285,6 +2285,9 @@ void ibss_mesh_setup_freq(struct wpa_sup vht_caps |= VHT_CAP_SUPP_CHAN_WIDTH_160MHZ; seg0 = 114; } @@ -53,6 +47,3 @@ index dcd787bec..ca893f942 100644 } if (hostapd_set_freq_params(&vht_freq, mode->mode, freq->freq, --- -2.17.0 - diff --git a/package/network/services/hostapd/patches/032-mesh-implement-use-of-VHT20-config-in-mesh-mode.patch b/package/network/services/hostapd/patches/032-mesh-implement-use-of-VHT20-config-in-mesh-mode.patch index 3bd6eaf340..bd28fb8de9 100644 --- a/package/network/services/hostapd/patches/032-mesh-implement-use-of-VHT20-config-in-mesh-mode.patch +++ b/package/network/services/hostapd/patches/032-mesh-implement-use-of-VHT20-config-in-mesh-mode.patch @@ -31,13 +31,11 @@ Signed-off-by: Peter Oh wpa_supplicant/wpa_supplicant.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) -diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c -index ca893f942..8429cfd43 100644 --- a/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c -@@ -2132,9 +2132,15 @@ void ibss_mesh_setup_freq(struct wpa_supplicant *wpa_s, - if (pri_chan->flag & (HOSTAPD_CHAN_DISABLED | HOSTAPD_CHAN_NO_IR)) - return; +@@ -2117,9 +2117,15 @@ void ibss_mesh_setup_freq(struct wpa_sup + if (!dfs_enabled) + return; + freq->channel = pri_chan->chan; + @@ -53,16 +51,16 @@ index ca893f942..8429cfd43 100644 #endif /* CONFIG_HT_OVERRIDES */ /* Check/setup HT40+/HT40- */ -@@ -2159,8 +2165,6 @@ void ibss_mesh_setup_freq(struct wpa_supplicant *wpa_s, - if (sec_chan->flag & (HOSTAPD_CHAN_DISABLED | HOSTAPD_CHAN_NO_IR)) - return; +@@ -2147,8 +2153,6 @@ void ibss_mesh_setup_freq(struct wpa_sup + if (!dfs_enabled) + return; - freq->channel = pri_chan->chan; - if (ht40 == -1) { if (!(pri_chan->flag & HOSTAPD_CHAN_HT40MINUS)) return; -@@ -2204,6 +2208,7 @@ void ibss_mesh_setup_freq(struct wpa_supplicant *wpa_s, +@@ -2192,6 +2196,7 @@ void ibss_mesh_setup_freq(struct wpa_sup wpa_scan_results_free(scan_res); } @@ -70,7 +68,7 @@ index ca893f942..8429cfd43 100644 wpa_printf(MSG_DEBUG, "IBSS/mesh: setup freq channel %d, sec_channel_offset %d", freq->channel, freq->sec_channel_offset); -@@ -2295,7 +2300,10 @@ void ibss_mesh_setup_freq(struct wpa_supplicant *wpa_s, +@@ -2287,7 +2292,10 @@ void ibss_mesh_setup_freq(struct wpa_sup } } else if (ssid->max_oper_chwidth == VHT_CHANWIDTH_USE_HT) { chwidth = VHT_CHANWIDTH_USE_HT; @@ -82,6 +80,3 @@ index ca893f942..8429cfd43 100644 } if (hostapd_set_freq_params(&vht_freq, mode->mode, freq->freq, --- -2.17.0 - diff --git a/package/network/services/hostapd/patches/200-multicall.patch b/package/network/services/hostapd/patches/200-multicall.patch index 56cb8f95cc..9f476210f7 100644 --- a/package/network/services/hostapd/patches/200-multicall.patch +++ b/package/network/services/hostapd/patches/200-multicall.patch @@ -156,7 +156,7 @@ wpa_cli.exe: wpa_cli --- a/src/drivers/driver.h +++ b/src/drivers/driver.h -@@ -5428,8 +5428,8 @@ union wpa_event_data { +@@ -5430,8 +5430,8 @@ union wpa_event_data { * Driver wrapper code should call this function whenever an event is received * from the driver. */ @@ -167,7 +167,7 @@ /** * wpa_supplicant_event_global - Report a driver event for wpa_supplicant -@@ -5441,7 +5441,7 @@ void wpa_supplicant_event(void *ctx, enu +@@ -5443,7 +5443,7 @@ void wpa_supplicant_event(void *ctx, enu * Same as wpa_supplicant_event(), but we search for the interface in * wpa_global. */ @@ -253,7 +253,7 @@ struct wpa_supplicant *wpa_s; --- a/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c -@@ -5725,7 +5725,6 @@ struct wpa_interface * wpa_supplicant_ma +@@ -5736,7 +5736,6 @@ struct wpa_interface * wpa_supplicant_ma return NULL; } @@ -261,7 +261,7 @@ /** * wpa_supplicant_match_existing - Match existing interfaces * @global: Pointer to global data from wpa_supplicant_init() -@@ -5762,6 +5761,11 @@ static int wpa_supplicant_match_existing +@@ -5773,6 +5772,11 @@ static int wpa_supplicant_match_existing #endif /* CONFIG_MATCH_IFACE */ @@ -273,7 +273,7 @@ /** * wpa_supplicant_add_iface - Add a new network interface -@@ -6018,6 +6022,8 @@ struct wpa_global * wpa_supplicant_init( +@@ -6029,6 +6033,8 @@ struct wpa_global * wpa_supplicant_init( #ifndef CONFIG_NO_WPA_MSG wpa_msg_register_ifname_cb(wpa_supplicant_msg_ifname_cb); #endif /* CONFIG_NO_WPA_MSG */ diff --git a/package/network/services/hostapd/patches/300-noscan.patch b/package/network/services/hostapd/patches/300-noscan.patch index e064ad7ebd..d5cf84fb37 100644 --- a/package/network/services/hostapd/patches/300-noscan.patch +++ b/package/network/services/hostapd/patches/300-noscan.patch @@ -13,7 +13,7 @@ } else if (os_strcmp(buf, "ht_capab") == 0) { --- a/src/ap/ap_config.h +++ b/src/ap/ap_config.h -@@ -761,6 +761,8 @@ struct hostapd_config { +@@ -763,6 +763,8 @@ struct hostapd_config { int ht_op_mode_fixed; u16 ht_capab; diff --git a/package/network/services/hostapd/patches/301-mesh-noscan.patch b/package/network/services/hostapd/patches/301-mesh-noscan.patch index 09b67a392b..b2c59bc5be 100644 --- a/package/network/services/hostapd/patches/301-mesh-noscan.patch +++ b/package/network/services/hostapd/patches/301-mesh-noscan.patch @@ -1,7 +1,5 @@ -Index: hostapd-2018-04-09-fa617ee6/wpa_supplicant/config.c -=================================================================== ---- hostapd-2018-04-09-fa617ee6.orig/wpa_supplicant/config.c -+++ hostapd-2018-04-09-fa617ee6/wpa_supplicant/config.c +--- a/wpa_supplicant/config.c ++++ b/wpa_supplicant/config.c @@ -2216,6 +2216,7 @@ static const struct parse_data ssid_fiel #else /* CONFIG_MESH */ { INT_RANGE(mode, 0, 4) }, @@ -10,10 +8,8 @@ Index: hostapd-2018-04-09-fa617ee6/wpa_supplicant/config.c { INT_RANGE(proactive_key_caching, 0, 1) }, { INT_RANGE(disabled, 0, 2) }, { STR(id_str) }, -Index: hostapd-2018-04-09-fa617ee6/wpa_supplicant/config_file.c -=================================================================== ---- hostapd-2018-04-09-fa617ee6.orig/wpa_supplicant/config_file.c -+++ hostapd-2018-04-09-fa617ee6/wpa_supplicant/config_file.c +--- a/wpa_supplicant/config_file.c ++++ b/wpa_supplicant/config_file.c @@ -816,6 +816,7 @@ static void wpa_config_write_network(FIL #endif /* IEEE8021X_EAPOL */ INT(mode); @@ -22,10 +18,8 @@ Index: hostapd-2018-04-09-fa617ee6/wpa_supplicant/config_file.c INT(mesh_fwding); INT(frequency); INT(fixed_freq); -Index: hostapd-2018-04-09-fa617ee6/wpa_supplicant/mesh.c -=================================================================== ---- hostapd-2018-04-09-fa617ee6.orig/wpa_supplicant/mesh.c -+++ hostapd-2018-04-09-fa617ee6/wpa_supplicant/mesh.c +--- a/wpa_supplicant/mesh.c ++++ b/wpa_supplicant/mesh.c @@ -287,6 +287,8 @@ static int wpa_supplicant_mesh_init(stru frequency); goto out_free; @@ -35,10 +29,8 @@ Index: hostapd-2018-04-09-fa617ee6/wpa_supplicant/mesh.c if (ssid->ht40) conf->secondary_channel = ssid->ht40; if (conf->hw_mode == HOSTAPD_MODE_IEEE80211A && ssid->vht) { -Index: hostapd-2018-04-09-fa617ee6/wpa_supplicant/wpa_supplicant.c -=================================================================== ---- hostapd-2018-04-09-fa617ee6.orig/wpa_supplicant/wpa_supplicant.c -+++ hostapd-2018-04-09-fa617ee6/wpa_supplicant/wpa_supplicant.c +--- a/wpa_supplicant/wpa_supplicant.c ++++ b/wpa_supplicant/wpa_supplicant.c @@ -2024,12 +2024,12 @@ void ibss_mesh_setup_freq(struct wpa_sup { enum hostapd_hw_mode hw_mode; @@ -63,10 +55,8 @@ Index: hostapd-2018-04-09-fa617ee6/wpa_supplicant/wpa_supplicant.c return; for (chan_idx = 0; chan_idx < mode->num_channels; chan_idx++) { -Index: hostapd-2018-04-09-fa617ee6/wpa_supplicant/config_ssid.h -=================================================================== ---- hostapd-2018-04-09-fa617ee6.orig/wpa_supplicant/config_ssid.h -+++ hostapd-2018-04-09-fa617ee6/wpa_supplicant/config_ssid.h +--- a/wpa_supplicant/config_ssid.h ++++ b/wpa_supplicant/config_ssid.h @@ -835,6 +835,8 @@ struct wpa_ssid { */ int no_auto_peer; diff --git a/package/network/services/hostapd/patches/310-rescan_immediately.patch b/package/network/services/hostapd/patches/310-rescan_immediately.patch index f4ee1d1f68..f504ba805f 100644 --- a/package/network/services/hostapd/patches/310-rescan_immediately.patch +++ b/package/network/services/hostapd/patches/310-rescan_immediately.patch @@ -1,6 +1,6 @@ --- a/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c -@@ -4176,7 +4176,7 @@ wpa_supplicant_alloc(struct wpa_supplica +@@ -4187,7 +4187,7 @@ wpa_supplicant_alloc(struct wpa_supplica if (wpa_s == NULL) return NULL; wpa_s->scan_req = INITIAL_SCAN_REQ; diff --git a/package/network/services/hostapd/patches/370-ap_sta_support.patch b/package/network/services/hostapd/patches/370-ap_sta_support.patch index f8cd34b00b..2f0c31848e 100644 --- a/package/network/services/hostapd/patches/370-ap_sta_support.patch +++ b/package/network/services/hostapd/patches/370-ap_sta_support.patch @@ -1,26 +1,3 @@ ---- a/wpa_supplicant/wpa_supplicant_i.h -+++ b/wpa_supplicant/wpa_supplicant_i.h -@@ -101,6 +101,11 @@ struct wpa_interface { - const char *ifname; - - /** -+ * hostapd_ctrl - path to hostapd control socket for notification -+ */ -+ const char *hostapd_ctrl; -+ -+ /** - * bridge_ifname - Optional bridge interface name - * - * If the driver interface (ifname) is included in a Linux bridge -@@ -513,6 +518,8 @@ struct wpa_supplicant { - #endif /* CONFIG_CTRL_IFACE_BINDER */ - char bridge_ifname[16]; - -+ struct wpa_ctrl *hostapd; -+ - char *confname; - char *confanother; - --- a/wpa_supplicant/Makefile +++ b/wpa_supplicant/Makefile @@ -26,6 +26,10 @@ CFLAGS += $(EXTRA_CFLAGS) @@ -43,6 +20,94 @@ ifndef CONFIG_OS ifdef CONFIG_NATIVE_WINDOWS CONFIG_OS=win32 +--- a/wpa_supplicant/bss.c ++++ b/wpa_supplicant/bss.c +@@ -11,6 +11,7 @@ + #include "utils/common.h" + #include "utils/eloop.h" + #include "common/ieee802_11_defs.h" ++#include "common/ieee802_11_common.h" + #include "drivers/driver.h" + #include "eap_peer/eap.h" + #include "wpa_supplicant_i.h" +@@ -290,6 +291,10 @@ void calculate_update_time(const struct + static void wpa_bss_copy_res(struct wpa_bss *dst, struct wpa_scan_res *src, + struct os_reltime *fetch_time) + { ++ struct ieee80211_ht_capabilities *capab; ++ struct ieee80211_ht_operation *oper; ++ struct ieee802_11_elems elems; ++ + dst->flags = src->flags; + os_memcpy(dst->bssid, src->bssid, ETH_ALEN); + dst->freq = src->freq; +@@ -302,6 +307,15 @@ static void wpa_bss_copy_res(struct wpa_ + dst->est_throughput = src->est_throughput; + dst->snr = src->snr; + ++ memset(&elems, 0, sizeof(elems)); ++ ieee802_11_parse_elems((u8 *) (src + 1), src->ie_len, &elems, 0); ++ capab = (struct ieee80211_ht_capabilities *) elems.ht_capabilities; ++ oper = (struct ieee80211_ht_operation *) elems.ht_operation; ++ if (capab) ++ dst->ht_capab = le_to_host16(capab->ht_capabilities_info); ++ if (oper) ++ dst->ht_param = oper->ht_param; ++ + calculate_update_time(fetch_time, src->age, &dst->last_update); + } + +--- a/wpa_supplicant/bss.h ++++ b/wpa_supplicant/bss.h +@@ -80,6 +80,10 @@ struct wpa_bss { + u8 ssid[SSID_MAX_LEN]; + /** Length of SSID */ + size_t ssid_len; ++ /** HT capabilities */ ++ u16 ht_capab; ++ /* Five octets of HT Operation Information */ ++ u8 ht_param; + /** Frequency of the channel in MHz (e.g., 2412 = channel 1) */ + int freq; + /** Beacon interval in TUs (host byte order) */ +--- a/wpa_supplicant/main.c ++++ b/wpa_supplicant/main.c +@@ -34,7 +34,7 @@ static void usage(void) + "vW] [-P] " + "[-g] \\\n" + " [-G] \\\n" +- " -i -c [-C] [-D] " ++ " -i -c [-C] [-D] [-H] " + "[-p] \\\n" + " [-b] [-e]" + #ifdef CONFIG_DEBUG_FILE +@@ -74,6 +74,7 @@ static void usage(void) + " -g = global ctrl_interface\n" + " -G = global ctrl_interface group\n" + " -h = show this help text\n" ++ " -H = connect to a hostapd instance to manage state changes\n" + " -i = interface name\n" + " -I = additional configuration file\n" + " -K = include keys (passwords, etc.) in debug output\n" +@@ -201,7 +202,7 @@ int main(int argc, char *argv[]) + + for (;;) { + c = getopt(argc, argv, +- "b:Bc:C:D:de:f:g:G:hi:I:KLMm:No:O:p:P:qsTtuvW"); ++ "b:Bc:C:D:de:f:g:G:hH:i:I:KLMm:No:O:p:P:qsTtuvW"); + if (c < 0) + break; + switch (c) { +@@ -248,6 +249,9 @@ int main(int argc, char *argv[]) + usage(); + exitcode = 0; + goto out; ++ case 'H': ++ iface->hostapd_ctrl = optarg; ++ break; + case 'i': + iface->ifname = optarg; + break; --- a/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c @@ -125,6 +125,55 @@ static void wpas_update_fils_connect_par @@ -118,15 +183,20 @@ wpa_s->new_connection = 1; wpa_drv_set_operstate(wpa_s, 0); #ifndef IEEE8021X_EAPOL -@@ -5351,6 +5404,20 @@ static int wpa_supplicant_init_iface(str +@@ -1920,6 +1973,8 @@ void wpa_supplicant_associate(struct wpa + wpa_ssid_txt(ssid->ssid, ssid->ssid_len), + ssid->id); + wpas_notify_mesh_group_started(wpa_s, ssid); ++ if (wpa_s->hostapd) ++ hostapd_reload(wpa_s, wpa_s->current_bss); + #else /* CONFIG_MESH */ + wpa_msg(wpa_s, MSG_ERROR, + "mesh mode support not included in the build"); +@@ -5362,6 +5417,16 @@ static int wpa_supplicant_init_iface(str sizeof(wpa_s->bridge_ifname)); } + if (iface->hostapd_ctrl) { -+ char *cmd = "STOP_AP"; -+ char buf[256]; -+ int len = sizeof(buf); -+ + wpa_s->hostapd = wpa_ctrl_open(iface->hostapd_ctrl); + if (!wpa_s->hostapd) { + wpa_printf(MSG_ERROR, "\nFailed to connect to hostapd\n"); @@ -139,7 +209,7 @@ /* RSNA Supplicant Key Management - INITIALIZE */ eapol_sm_notify_portEnabled(wpa_s->eapol, FALSE); eapol_sm_notify_portValid(wpa_s->eapol, FALSE); -@@ -5672,6 +5739,11 @@ static void wpa_supplicant_deinit_iface( +@@ -5683,6 +5748,11 @@ static void wpa_supplicant_deinit_iface( if (terminate) wpa_msg(wpa_s, MSG_INFO, WPA_EVENT_TERMINATING); @@ -151,91 +221,26 @@ if (wpa_s->ctrl_iface) { wpa_supplicant_ctrl_iface_deinit(wpa_s->ctrl_iface); wpa_s->ctrl_iface = NULL; ---- a/wpa_supplicant/bss.c -+++ b/wpa_supplicant/bss.c -@@ -11,6 +11,7 @@ - #include "utils/common.h" - #include "utils/eloop.h" - #include "common/ieee802_11_defs.h" -+#include "common/ieee802_11_common.h" - #include "drivers/driver.h" - #include "eap_peer/eap.h" - #include "wpa_supplicant_i.h" -@@ -290,6 +291,10 @@ void calculate_update_time(const struct - static void wpa_bss_copy_res(struct wpa_bss *dst, struct wpa_scan_res *src, - struct os_reltime *fetch_time) - { -+ struct ieee80211_ht_capabilities *capab; -+ struct ieee80211_ht_operation *oper; -+ struct ieee802_11_elems elems; +--- a/wpa_supplicant/wpa_supplicant_i.h ++++ b/wpa_supplicant/wpa_supplicant_i.h +@@ -101,6 +101,11 @@ struct wpa_interface { + const char *ifname; + + /** ++ * hostapd_ctrl - path to hostapd control socket for notification ++ */ ++ const char *hostapd_ctrl; + - dst->flags = src->flags; - os_memcpy(dst->bssid, src->bssid, ETH_ALEN); - dst->freq = src->freq; -@@ -302,6 +307,15 @@ static void wpa_bss_copy_res(struct wpa_ - dst->est_throughput = src->est_throughput; - dst->snr = src->snr; ++ /** + * bridge_ifname - Optional bridge interface name + * + * If the driver interface (ifname) is included in a Linux bridge +@@ -513,6 +518,8 @@ struct wpa_supplicant { + #endif /* CONFIG_CTRL_IFACE_BINDER */ + char bridge_ifname[16]; -+ memset(&elems, 0, sizeof(elems)); -+ ieee802_11_parse_elems((u8 *) (src + 1), src->ie_len, &elems, 0); -+ capab = (struct ieee80211_ht_capabilities *) elems.ht_capabilities; -+ oper = (struct ieee80211_ht_operation *) elems.ht_operation; -+ if (capab) -+ dst->ht_capab = le_to_host16(capab->ht_capabilities_info); -+ if (oper) -+ dst->ht_param = oper->ht_param; ++ struct wpa_ctrl *hostapd; + - calculate_update_time(fetch_time, src->age, &dst->last_update); - } + char *confname; + char *confanother; ---- a/wpa_supplicant/main.c -+++ b/wpa_supplicant/main.c -@@ -34,7 +34,7 @@ static void usage(void) - "vW] [-P] " - "[-g] \\\n" - " [-G] \\\n" -- " -i -c [-C] [-D] " -+ " -i -c [-C] [-D] [-H] " - "[-p] \\\n" - " [-b] [-e]" - #ifdef CONFIG_DEBUG_FILE -@@ -74,6 +74,7 @@ static void usage(void) - " -g = global ctrl_interface\n" - " -G = global ctrl_interface group\n" - " -h = show this help text\n" -+ " -H = connect to a hostapd instance to manage state changes\n" - " -i = interface name\n" - " -I = additional configuration file\n" - " -K = include keys (passwords, etc.) in debug output\n" -@@ -201,7 +202,7 @@ int main(int argc, char *argv[]) - - for (;;) { - c = getopt(argc, argv, -- "b:Bc:C:D:de:f:g:G:hi:I:KLMm:No:O:p:P:qsTtuvW"); -+ "b:Bc:C:D:de:f:g:G:hH:i:I:KLMm:No:O:p:P:qsTtuvW"); - if (c < 0) - break; - switch (c) { -@@ -248,6 +249,9 @@ int main(int argc, char *argv[]) - usage(); - exitcode = 0; - goto out; -+ case 'H': -+ iface->hostapd_ctrl = optarg; -+ break; - case 'i': - iface->ifname = optarg; - break; ---- a/wpa_supplicant/bss.h -+++ b/wpa_supplicant/bss.h -@@ -80,6 +80,10 @@ struct wpa_bss { - u8 ssid[SSID_MAX_LEN]; - /** Length of SSID */ - size_t ssid_len; -+ /** HT capabilities */ -+ u16 ht_capab; -+ /* Five octets of HT Operation Information */ -+ u8 ht_param; - /** Frequency of the channel in MHz (e.g., 2412 = channel 1) */ - int freq; - /** Beacon interval in TUs (host byte order) */ diff --git a/package/network/services/hostapd/patches/460-wpa_supplicant-add-new-config-params-to-be-used-with.patch b/package/network/services/hostapd/patches/460-wpa_supplicant-add-new-config-params-to-be-used-with.patch index cab0325dd6..a8ae70196d 100644 --- a/package/network/services/hostapd/patches/460-wpa_supplicant-add-new-config-params-to-be-used-with.patch +++ b/package/network/services/hostapd/patches/460-wpa_supplicant-add-new-config-params-to-be-used-with.patch @@ -140,7 +140,7 @@ Signed-hostap: Antonio Quartulli /* Helper macros for network block parser */ #ifdef OFFSET -@@ -2279,6 +2371,8 @@ static const struct parse_data ssid_fiel +@@ -2281,6 +2373,8 @@ static const struct parse_data ssid_fiel { INT(ap_max_inactivity) }, { INT(dtim_period) }, { INT(beacon_int) }, @@ -162,7 +162,7 @@ Signed-hostap: Antonio Quartulli #define DEFAULT_EAP_WORKAROUND ((unsigned int) -1) -@@ -743,6 +745,9 @@ struct wpa_ssid { +@@ -749,6 +751,9 @@ struct wpa_ssid { */ void *parent_cred; @@ -174,7 +174,7 @@ Signed-hostap: Antonio Quartulli * macsec_policy - Determines the policy for MACsec secure session --- a/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c -@@ -2987,6 +2987,12 @@ static void wpas_start_assoc_cb(struct w +@@ -3000,6 +3000,12 @@ static void wpas_start_assoc_cb(struct w params.beacon_int = ssid->beacon_int; else params.beacon_int = wpa_s->conf->beacon_int; diff --git a/package/network/services/hostapd/patches/463-add-mcast_rate-to-11s.patch b/package/network/services/hostapd/patches/463-add-mcast_rate-to-11s.patch index b868884a97..6216bf5003 100644 --- a/package/network/services/hostapd/patches/463-add-mcast_rate-to-11s.patch +++ b/package/network/services/hostapd/patches/463-add-mcast_rate-to-11s.patch @@ -19,7 +19,7 @@ Tested-by: Simon Wunderlich --- a/src/drivers/driver.h +++ b/src/drivers/driver.h -@@ -1395,6 +1395,7 @@ struct wpa_driver_mesh_join_params { +@@ -1397,6 +1397,7 @@ struct wpa_driver_mesh_join_params { #define WPA_DRIVER_MESH_FLAG_AMPE 0x00000008 unsigned int flags; u8 handle_dfs; @@ -48,7 +48,7 @@ Tested-by: Simon Wunderlich static int nl80211_put_mesh_config(struct nl_msg *msg, struct wpa_driver_mesh_bss_params *params) { -@@ -9275,6 +9287,7 @@ static int nl80211_join_mesh(struct i802 +@@ -9278,6 +9290,7 @@ static int nl80211_join_mesh(struct i802 nl80211_put_basic_rates(msg, params->basic_rates) || nl80211_put_mesh_id(msg, params->meshid, params->meshid_len) || nl80211_put_beacon_int(msg, params->beacon_int) || @@ -58,7 +58,7 @@ Tested-by: Simon Wunderlich --- a/wpa_supplicant/mesh.c +++ b/wpa_supplicant/mesh.c -@@ -448,6 +448,7 @@ int wpa_supplicant_join_mesh(struct wpa_ +@@ -456,6 +456,7 @@ int wpa_supplicant_join_mesh(struct wpa_ params->meshid = ssid->ssid; params->meshid_len = ssid->ssid_len; diff --git a/package/network/services/hostapd/patches/464-fix-mesh-obss-check.patch b/package/network/services/hostapd/patches/464-fix-mesh-obss-check.patch index 48682abd04..df056f2074 100644 --- a/package/network/services/hostapd/patches/464-fix-mesh-obss-check.patch +++ b/package/network/services/hostapd/patches/464-fix-mesh-obss-check.patch @@ -1,6 +1,6 @@ --- a/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c -@@ -2095,11 +2095,13 @@ void ibss_mesh_setup_freq(struct wpa_sup +@@ -2097,11 +2097,13 @@ void ibss_mesh_setup_freq(struct wpa_sup for (j = 0; j < wpa_s->last_scan_res_used; j++) { struct wpa_bss *bss = wpa_s->last_scan_res[j];