aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--package/network/services/hostapd/Makefile6
-rw-r--r--package/network/services/hostapd/patches/010-mesh-Allow-DFS-channels-to-be-selected-if-dfs-is-ena.patch60
-rw-r--r--package/network/services/hostapd/patches/020-mesh-make-forwarding-configurable.patch219
-rw-r--r--package/network/services/hostapd/patches/301-mesh-noscan.patch15
-rw-r--r--package/network/services/hostapd/patches/470-survey_data_fallback.patch22
-rw-r--r--package/network/services/hostapd/patches/550-WNM-allow-specifying-dialog-token.patch99
-rw-r--r--package/network/services/hostapd/patches/720-ACS-fix-channel-100-frequency.patch30
-rw-r--r--package/network/services/hostapd/patches/741-proxyarp-fix-compilation-with-Hotspot-2.0-disabled.patch51
-rw-r--r--package/network/services/hostapd/src/src/ap/ubus.c2
9 files changed, 57 insertions, 447 deletions
diff --git a/package/network/services/hostapd/Makefile b/package/network/services/hostapd/Makefile
index 7e4056bb18..584695786f 100644
--- a/package/network/services/hostapd/Makefile
+++ b/package/network/services/hostapd/Makefile
@@ -9,9 +9,9 @@ PKG_RELEASE:=$(AUTORELEASE)
PKG_SOURCE_URL:=http://w1.fi/hostap.git
PKG_SOURCE_PROTO:=git
-PKG_SOURCE_DATE:=2021-05-22
-PKG_SOURCE_VERSION:=b102f19bcc53c7f7db3951424d4d46709b4f1986
-PKG_MIRROR_HASH:=cb3cb968883042fc582752be1607586696c18e6ecf9808c9a8ac50e204584367
+PKG_SOURCE_DATE:=2022-01-16
+PKG_SOURCE_VERSION:=cff80b4f7d3c0a47c052e8187d671710f48939e4
+PKG_MIRROR_HASH:=712965bfa11a2e601d3e1c9a51a2cf3cffc6db89abafb3df3eb0cfd83c64705b
PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
PKG_LICENSE:=BSD-3-Clause
diff --git a/package/network/services/hostapd/patches/010-mesh-Allow-DFS-channels-to-be-selected-if-dfs-is-ena.patch b/package/network/services/hostapd/patches/010-mesh-Allow-DFS-channels-to-be-selected-if-dfs-is-ena.patch
index d948c41b30..16d24d1000 100644
--- a/package/network/services/hostapd/patches/010-mesh-Allow-DFS-channels-to-be-selected-if-dfs-is-ena.patch
+++ b/package/network/services/hostapd/patches/010-mesh-Allow-DFS-channels-to-be-selected-if-dfs-is-ena.patch
@@ -14,16 +14,37 @@ Signed-off-by: Peter Oh <peter.oh@bowerswilkins.com>
--- a/wpa_supplicant/wpa_supplicant.c
+++ b/wpa_supplicant/wpa_supplicant.c
-@@ -2395,6 +2395,8 @@ void ibss_mesh_setup_freq(struct wpa_sup
+@@ -2409,7 +2409,7 @@ static int drv_supports_vht(struct wpa_s
+ }
+
+
+-static bool ibss_mesh_is_80mhz_avail(int channel, struct hostapd_hw_modes *mode)
++static bool ibss_mesh_is_80mhz_avail(int channel, struct hostapd_hw_modes *mode, bool dfs_enabled)
+ {
+ int i;
+
+@@ -2418,7 +2418,10 @@ static bool ibss_mesh_is_80mhz_avail(int
+
+ chan = hw_get_channel_chan(mode, i, NULL);
+ if (!chan ||
+- chan->flag & (HOSTAPD_CHAN_DISABLED | HOSTAPD_CHAN_NO_IR))
++ chan->flag & HOSTAPD_CHAN_DISABLED)
++ return false;
++
++ if (!dfs_enabled && chan->flag & (HOSTAPD_CHAN_RADAR | HOSTAPD_CHAN_NO_IR))
+ return false;
+ }
+
+@@ -2447,6 +2450,8 @@ void ibss_mesh_setup_freq(struct wpa_sup
int chwidth, seg0, seg1;
u32 vht_caps = 0;
- int is_24ghz;
-+ int dfs_enabled = wpa_s->conf->country[0] &&
-+ (wpa_s->drv_flags & WPA_DRIVER_FLAGS_RADAR);
+ bool is_24ghz, is_6ghz;
++ bool dfs_enabled = wpa_s->conf->country[0] &&
++ (wpa_s->drv_flags & WPA_DRIVER_FLAGS_RADAR);
freq->freq = ssid->frequency;
-@@ -2484,8 +2486,11 @@ void ibss_mesh_setup_freq(struct wpa_sup
+@@ -2543,8 +2548,11 @@ void ibss_mesh_setup_freq(struct wpa_sup
return;
/* Check primary channel flags */
@@ -36,7 +57,7 @@ Signed-off-by: Peter Oh <peter.oh@bowerswilkins.com>
freq->channel = pri_chan->chan;
-@@ -2518,8 +2523,11 @@ void ibss_mesh_setup_freq(struct wpa_sup
+@@ -2577,8 +2585,11 @@ void ibss_mesh_setup_freq(struct wpa_sup
return;
/* Check secondary channel flags */
@@ -49,20 +70,25 @@ Signed-off-by: Peter Oh <peter.oh@bowerswilkins.com>
if (ht40 == -1) {
if (!(pri_chan->flag & HOSTAPD_CHAN_HT40MINUS))
-@@ -2612,8 +2620,11 @@ skip_ht40:
- return;
+@@ -2667,7 +2678,7 @@ skip_to_6ghz:
+ return;
- /* Back to HT configuration if channel not usable */
-- if (chan->flag & (HOSTAPD_CHAN_DISABLED | HOSTAPD_CHAN_NO_IR))
-+ if (chan->flag & HOSTAPD_CHAN_DISABLED)
- return;
-+ if (chan->flag & (HOSTAPD_CHAN_RADAR | HOSTAPD_CHAN_NO_IR))
-+ if (!dfs_enabled)
-+ return;
- }
+ /* Back to HT configuration if channel not usable */
+- if (!ibss_mesh_is_80mhz_avail(channel, mode))
++ if (!ibss_mesh_is_80mhz_avail(channel, mode, dfs_enabled))
+ return;
chwidth = CHANWIDTH_80MHZ;
-@@ -2633,10 +2644,12 @@ skip_ht40:
+@@ -2681,7 +2692,7 @@ skip_to_6ghz:
+ * above; check the remaining four 20 MHz channels for the total
+ * of 160 MHz bandwidth.
+ */
+- if (!ibss_mesh_is_80mhz_avail(channel + 16, mode))
++ if (!ibss_mesh_is_80mhz_avail(channel + 16, mode, dfs_enabled))
+ return;
+
+ for (j = 0; j < ARRAY_SIZE(bw160); j++) {
+@@ -2711,10 +2722,12 @@ skip_to_6ghz:
if (!chan)
continue;
diff --git a/package/network/services/hostapd/patches/020-mesh-make-forwarding-configurable.patch b/package/network/services/hostapd/patches/020-mesh-make-forwarding-configurable.patch
deleted file mode 100644
index 75726a6750..0000000000
--- a/package/network/services/hostapd/patches/020-mesh-make-forwarding-configurable.patch
+++ /dev/null
@@ -1,219 +0,0 @@
-From 90fe6429624fc48bc0e5d2d7eeecb7498708b5e3 Mon Sep 17 00:00:00 2001
-From: Daniel Golle <daniel@makrotopia.org>
-Date: Wed, 18 Apr 2018 19:24:31 +0200
-Subject: [PATCH 18/18] mesh: make forwarding configurable
-
-Allow mesh_fwding to be specified in a mesh bss config, pass that
-to the driver (only nl80211 implemented for now) and announce
-forwarding capability accordingly.
-
-Signed-off-by: Daniel Golle <daniel@makrotopia.org>
----
- src/ap/ap_config.h | 2 ++
- src/drivers/driver.h | 2 ++
- src/drivers/driver_nl80211.c | 3 +++
- wpa_supplicant/config.c | 4 ++++
- wpa_supplicant/config.h | 9 +++++++++
- wpa_supplicant/config_file.c | 4 ++++
- wpa_supplicant/config_ssid.h | 5 +++++
- wpa_supplicant/mesh.c | 6 ++++++
- wpa_supplicant/mesh_mpm.c | 4 ++--
- wpa_supplicant/wpa_supplicant.conf | 3 +++
- 10 files changed, 40 insertions(+), 2 deletions(-)
-
---- a/src/ap/ap_config.h
-+++ b/src/ap/ap_config.h
-@@ -51,6 +51,7 @@ struct mesh_conf {
- int dot11MeshRetryTimeout; /* msec */
- int dot11MeshConfirmTimeout; /* msec */
- int dot11MeshHoldingTimeout; /* msec */
-+ int mesh_fwding;
- };
-
- #define MAX_STA_COUNT 2007
-@@ -696,6 +697,7 @@ struct hostapd_bss_config {
-
- #define MESH_ENABLED BIT(0)
- int mesh;
-+ int mesh_fwding;
-
- u8 radio_measurements[RRM_CAPABILITIES_IE_LEN];
-
---- a/src/drivers/driver.h
-+++ b/src/drivers/driver.h
-@@ -1584,6 +1584,7 @@ struct wpa_driver_mesh_bss_params {
- #define WPA_DRIVER_MESH_CONF_FLAG_MAX_PEER_LINKS 0x00000004
- #define WPA_DRIVER_MESH_CONF_FLAG_HT_OP_MODE 0x00000008
- #define WPA_DRIVER_MESH_CONF_FLAG_RSSI_THRESHOLD 0x00000010
-+#define WPA_DRIVER_MESH_CONF_FLAG_FORWARDING 0x00000020
- /*
- * TODO: Other mesh configuration parameters would go here.
- * See NL80211_MESHCONF_* for all the mesh config parameters.
-@@ -1593,6 +1594,7 @@ struct wpa_driver_mesh_bss_params {
- int peer_link_timeout;
- int max_peer_links;
- int rssi_threshold;
-+ int forwarding;
- u16 ht_opmode;
- };
-
---- a/src/drivers/driver_nl80211.c
-+++ b/src/drivers/driver_nl80211.c
-@@ -10456,6 +10456,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)) ||
-+ ((params->flags & WPA_DRIVER_MESH_CONF_FLAG_FORWARDING) &&
-+ nla_put_u8(msg, NL80211_MESHCONF_FORWARDING,
-+ params->forwarding)) ||
- ((params->flags & WPA_DRIVER_MESH_CONF_FLAG_MAX_PEER_LINKS) &&
- nla_put_u16(msg, NL80211_MESHCONF_MAX_PEER_LINKS,
- params->max_peer_links)) ||
---- a/wpa_supplicant/config.c
-+++ b/wpa_supplicant/config.c
-@@ -2527,6 +2527,7 @@ static const struct parse_data ssid_fiel
- #ifdef CONFIG_MESH
- { INT_RANGE(mode, 0, 5) },
- { INT_RANGE(no_auto_peer, 0, 1) },
-+ { INT_RANGE(mesh_fwding, 0, 1) },
- { INT_RANGE(mesh_rssi_threshold, -255, 1) },
- #else /* CONFIG_MESH */
- { INT_RANGE(mode, 0, 4) },
-@@ -3106,6 +3107,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;
-+ ssid->mesh_fwding = DEFAULT_MESH_FWDING;
- ssid->mesh_rssi_threshold = DEFAULT_MESH_RSSI_THRESHOLD;
- #endif /* CONFIG_MESH */
- #ifdef CONFIG_HT_OVERRIDES
-@@ -4347,6 +4349,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;
-+ config->mesh_fwding = DEFAULT_MESH_FWDING;
- config->dot11RSNASAERetransPeriod =
- DEFAULT_DOT11_RSNA_SAE_RETRANS_PERIOD;
- config->fast_reauth = DEFAULT_FAST_REAUTH;
-@@ -5047,6 +5050,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 },
-+ { INT_RANGE(mesh_fwding, 0, 1), 0 },
- { INT(dot11RSNASAERetransPeriod), 0 },
- #endif /* CONFIG_MESH */
- { INT(disable_scan_offload), 0 },
---- a/wpa_supplicant/config.h
-+++ b/wpa_supplicant/config.h
-@@ -18,6 +18,7 @@
- #define DEFAULT_USER_MPM 1
- #define DEFAULT_MAX_PEER_LINKS 99
- #define DEFAULT_MESH_MAX_INACTIVITY 300
-+#define DEFAULT_MESH_FWDING 1
- /*
- * The default dot11RSNASAERetransPeriod is defined as 40 ms in the standard,
- * but use 1000 ms in practice to avoid issues on low power CPUs.
-@@ -1378,6 +1379,14 @@ struct wpa_config {
- int mesh_max_inactivity;
-
- /**
-+ * mesh_fwding - Mesh network layer-2 forwarding
-+ *
-+ * This controls whether to enable layer-2 forwarding.
-+ * By default: 1: enabled
-+ */
-+ int mesh_fwding;
-+
-+ /**
- * dot11RSNASAERetransPeriod - Timeout to retransmit SAE Auth frame
- *
- * This timeout value is used in mesh STA to retransmit
---- a/wpa_supplicant/config_file.c
-+++ b/wpa_supplicant/config_file.c
-@@ -768,6 +768,7 @@ static void wpa_config_write_network(FIL
- #endif /* IEEE8021X_EAPOL */
- INT(mode);
- INT(no_auto_peer);
-+ INT(mesh_fwding);
- INT(frequency);
- INT(enable_edmg);
- INT(edmg_channel);
-@@ -1449,6 +1450,9 @@ static void wpa_config_write_global(FILE
- fprintf(f, "mesh_max_inactivity=%d\n",
- config->mesh_max_inactivity);
-
-+ if (config->mesh_fwding != DEFAULT_MESH_FWDING)
-+ fprintf(f, "mesh_fwding=%d\n", config->mesh_fwding);
-+
- if (config->dot11RSNASAERetransPeriod !=
- DEFAULT_DOT11_RSNA_SAE_RETRANS_PERIOD)
- fprintf(f, "dot11RSNASAERetransPeriod=%d\n",
---- a/wpa_supplicant/config_ssid.h
-+++ b/wpa_supplicant/config_ssid.h
-@@ -546,6 +546,11 @@ struct wpa_ssid {
- int dot11MeshConfirmTimeout; /* msec */
- int dot11MeshHoldingTimeout; /* msec */
-
-+ /**
-+ * Mesh network layer-2 forwarding
-+ */
-+ int mesh_fwding;
-+
- int ht;
- int ht40;
-
---- a/wpa_supplicant/mesh.c
-+++ b/wpa_supplicant/mesh.c
-@@ -140,6 +140,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;
-+ conf->mesh_fwding = ssid->mesh_fwding;
- conf->dot11MeshMaxRetries = ssid->dot11MeshMaxRetries;
- conf->dot11MeshRetryTimeout = ssid->dot11MeshRetryTimeout;
- conf->dot11MeshConfirmTimeout = ssid->dot11MeshConfirmTimeout;
-@@ -441,6 +442,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;
-+ bss->conf->mesh_fwding = wpa_s->conf->mesh_fwding;
-
- if (ieee80211_is_dfs(ssid->frequency, wpa_s->hw.modes,
- wpa_s->hw.num_modes) && wpa_s->conf->country[0]) {
-@@ -655,6 +657,10 @@ int wpa_supplicant_join_mesh(struct wpa_
- }
- params->conf.peer_link_timeout = wpa_s->conf->mesh_max_inactivity;
-
-+ /* always explicitely set forwarding to on or off for now */
-+ params->conf.flags |= WPA_DRIVER_MESH_CONF_FLAG_FORWARDING;
-+ params->conf.forwarding = ssid->mesh_fwding;
-+
- os_free(wpa_s->mesh_params);
- wpa_s->mesh_params = params;
- if (wpa_supplicant_mesh_init(wpa_s, ssid, &params->freq)) {
---- a/wpa_supplicant/mesh_mpm.c
-+++ b/wpa_supplicant/mesh_mpm.c
-@@ -303,9 +303,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);
-- /* always forwarding & accepting plinks for now */
-+ /* set forwarding & always accepting plinks for now */
- wpabuf_put_u8(buf, MESH_CAP_ACCEPT_ADDITIONAL_PEER |
-- MESH_CAP_FORWARDING);
-+ (conf->mesh_fwding ? MESH_CAP_FORWARDING : 0));
- } else { /* Peer closing frame */
- /* IE: Mesh ID */
- wpabuf_put_u8(buf, WLAN_EID_MESH_ID);
---- a/wpa_supplicant/wpa_supplicant.conf
-+++ b/wpa_supplicant/wpa_supplicant.conf
-@@ -150,6 +150,9 @@ ap_scan=1
- # This timeout value is used in mesh STA to clean up inactive stations.
- #mesh_max_inactivity=300
-
-+# Enable 802.11s layer-2 routing and forwarding
-+#mesh_fwding=1
-+
- # 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
diff --git a/package/network/services/hostapd/patches/301-mesh-noscan.patch b/package/network/services/hostapd/patches/301-mesh-noscan.patch
index 0d78329441..e593ac49fe 100644
--- a/package/network/services/hostapd/patches/301-mesh-noscan.patch
+++ b/package/network/services/hostapd/patches/301-mesh-noscan.patch
@@ -10,7 +10,7 @@
{ STR(id_str) },
--- a/wpa_supplicant/config_file.c
+++ b/wpa_supplicant/config_file.c
-@@ -768,6 +768,7 @@ static void wpa_config_write_network(FIL
+@@ -769,6 +769,7 @@ static void wpa_config_write_network(FIL
#endif /* IEEE8021X_EAPOL */
INT(mode);
INT(no_auto_peer);
@@ -20,7 +20,7 @@
INT(enable_edmg);
--- a/wpa_supplicant/mesh.c
+++ b/wpa_supplicant/mesh.c
-@@ -474,6 +474,8 @@ static int wpa_supplicant_mesh_init(stru
+@@ -506,6 +506,8 @@ static int wpa_supplicant_mesh_init(stru
frequency);
goto out_free;
}
@@ -31,14 +31,17 @@
/*
--- a/wpa_supplicant/wpa_supplicant.c
+++ b/wpa_supplicant/wpa_supplicant.c
-@@ -2384,12 +2384,12 @@ void ibss_mesh_setup_freq(struct wpa_sup
+@@ -2436,7 +2436,7 @@ void ibss_mesh_setup_freq(struct wpa_sup
int ieee80211_mode = wpas_mode_to_ieee80211_mode(ssid->mode);
enum hostapd_hw_mode hw_mode;
struct hostapd_hw_modes *mode = NULL;
- int ht40plus[] = { 36, 44, 52, 60, 100, 108, 116, 124, 132, 149, 157,
+ int ht40plus[] = { 1, 2, 3, 4, 5, 6, 36, 44, 52, 60, 100, 108, 116, 124, 132, 149, 157,
184, 192 };
- int vht80[] = { 36, 52, 100, 116, 132, 149 };
+ int bw80[] = { 5180, 5260, 5500, 5580, 5660, 5745, 5955,
+ 6035, 6115, 6195, 6275, 6355, 6435, 6515,
+@@ -2444,7 +2444,7 @@ void ibss_mesh_setup_freq(struct wpa_sup
+ int bw160[] = { 5955, 6115, 6275, 6435, 6595, 6755, 6915 };
struct hostapd_channel_data *pri_chan = NULL, *sec_chan = NULL;
u8 channel;
- int i, chan_idx, ht40 = -1, res, obss_scan = 1;
@@ -46,7 +49,7 @@
unsigned int j, k;
struct hostapd_freq_params vht_freq;
int chwidth, seg0, seg1;
-@@ -2473,7 +2473,7 @@ void ibss_mesh_setup_freq(struct wpa_sup
+@@ -2535,7 +2535,7 @@ void ibss_mesh_setup_freq(struct wpa_sup
#endif /* CONFIG_HE_OVERRIDES */
/* Setup higher BW only for 5 GHz */
@@ -57,7 +60,7 @@
for (chan_idx = 0; chan_idx < mode->num_channels; chan_idx++) {
--- a/wpa_supplicant/config_ssid.h
+++ b/wpa_supplicant/config_ssid.h
-@@ -971,6 +971,8 @@ struct wpa_ssid {
+@@ -979,6 +979,8 @@ struct wpa_ssid {
*/
int no_auto_peer;
diff --git a/package/network/services/hostapd/patches/470-survey_data_fallback.patch b/package/network/services/hostapd/patches/470-survey_data_fallback.patch
index efd82599d3..359b5f3ef8 100644
--- a/package/network/services/hostapd/patches/470-survey_data_fallback.patch
+++ b/package/network/services/hostapd/patches/470-survey_data_fallback.patch
@@ -1,26 +1,6 @@
--- a/src/ap/acs.c
+++ b/src/ap/acs.c
-@@ -302,18 +302,12 @@ static void acs_fail(struct hostapd_ifac
- static long double
- acs_survey_interference_factor(struct freq_survey *survey, s8 min_nf)
- {
-- long double factor, busy, total;
-+ long double factor, busy = 0, total;
-
- if (survey->filled & SURVEY_HAS_CHAN_TIME_BUSY)
- busy = survey->channel_time_busy;
- else if (survey->filled & SURVEY_HAS_CHAN_TIME_RX)
- busy = survey->channel_time_rx;
-- else {
-- /* This shouldn't really happen as survey data is checked in
-- * acs_sanity_check() */
-- wpa_printf(MSG_ERROR, "ACS: Survey data missing");
-- return 0;
-- }
-
- total = survey->channel_time;
-
-@@ -422,20 +416,19 @@ static int acs_usable_bw160_chan(const s
+@@ -420,20 +420,19 @@ static int acs_usable_bw160_chan(const s
static int acs_survey_is_sufficient(struct freq_survey *survey)
{
if (!(survey->filled & SURVEY_HAS_NF)) {
diff --git a/package/network/services/hostapd/patches/550-WNM-allow-specifying-dialog-token.patch b/package/network/services/hostapd/patches/550-WNM-allow-specifying-dialog-token.patch
deleted file mode 100644
index 6c080adc0e..0000000000
--- a/package/network/services/hostapd/patches/550-WNM-allow-specifying-dialog-token.patch
+++ /dev/null
@@ -1,99 +0,0 @@
-From 1b26807938815d0b0b266caf31d8ef0019607e64 Mon Sep 17 00:00:00 2001
-From: David Bauer <mail@david-bauer.net>
-Date: Mon, 27 Sep 2021 15:41:48 +0200
-Subject: [PATCH] WNM: allow specifying dialog-token
-
-This commit adds the ability to specify the dialog token of a WNM BSS
-Transition request frame via the hostapd control socket.
-
-FOr this, the new 'dialog_token' option can be used. It accepts values
-as a 8 bit unsigned integer. If not specified, the dialog token is set
-to 1 like before.
-
-Signed-off-by: David Bauer <mail@david-bauer.net>
----
- hostapd/ctrl_iface.c | 10 ++++++++--
- src/ap/wnm_ap.c | 11 ++++++-----
- src/ap/wnm_ap.h | 4 ++--
- 3 files changed, 16 insertions(+), 9 deletions(-)
-
---- a/hostapd/ctrl_iface.c
-+++ b/hostapd/ctrl_iface.c
-@@ -897,7 +897,7 @@ static int hostapd_ctrl_iface_bss_tm_req
- const char *pos, *end;
- int disassoc_timer = 0;
- struct sta_info *sta;
-- u8 req_mode = 0, valid_int = 0x01;
-+ u8 req_mode = 0, valid_int = 0x01, dialog_token = 0x01;
- u8 bss_term_dur[12];
- char *url = NULL;
- int ret;
-@@ -935,6 +935,12 @@ static int hostapd_ctrl_iface_bss_tm_req
- valid_int = atoi(pos);
- }
-
-+ pos = os_strstr(cmd, " dialog_token=");
-+ if (pos) {
-+ pos += 14;
-+ dialog_token = atoi(pos);
-+ }
-+
- pos = os_strstr(cmd, " bss_term=");
- if (pos) {
- pos += 10;
-@@ -1041,7 +1047,7 @@ static int hostapd_ctrl_iface_bss_tm_req
- #endif /* CONFIG_MBO */
-
- ret = wnm_send_bss_tm_req(hapd, sta, req_mode, disassoc_timer,
-- valid_int, bss_term_dur, url,
-+ valid_int, bss_term_dur, dialog_token, url,
- nei_len ? nei_rep : NULL, nei_len,
- mbo_len ? mbo : NULL, mbo_len);
- #ifdef CONFIG_MBO
---- a/src/ap/wnm_ap.c
-+++ b/src/ap/wnm_ap.c
-@@ -788,8 +788,8 @@ int wnm_send_ess_disassoc_imminent(struc
-
- int wnm_send_bss_tm_req(struct hostapd_data *hapd, struct sta_info *sta,
- u8 req_mode, int disassoc_timer, u8 valid_int,
-- const u8 *bss_term_dur, const char *url,
-- const u8 *nei_rep, size_t nei_rep_len,
-+ const u8 *bss_term_dur, u8 dialog_token,
-+ const char *url, const u8 *nei_rep, size_t nei_rep_len,
- const u8 *mbo_attrs, size_t mbo_len)
- {
- u8 *buf, *pos;
-@@ -797,8 +797,9 @@ int wnm_send_bss_tm_req(struct hostapd_d
- size_t url_len;
-
- wpa_printf(MSG_DEBUG, "WNM: Send BSS Transition Management Request to "
-- MACSTR " req_mode=0x%x disassoc_timer=%d valid_int=0x%x",
-- MAC2STR(sta->addr), req_mode, disassoc_timer, valid_int);
-+ MACSTR " req_mode=0x%x disassoc_timer=%d valid_int=0x%x "
-+ "dialog_token=%x",
-+ MAC2STR(sta->addr), req_mode, disassoc_timer, valid_int, dialog_token);
- buf = os_zalloc(1000 + nei_rep_len + mbo_len);
- if (buf == NULL)
- return -1;
-@@ -810,7 +811,7 @@ int wnm_send_bss_tm_req(struct hostapd_d
- os_memcpy(mgmt->bssid, hapd->own_addr, ETH_ALEN);
- mgmt->u.action.category = WLAN_ACTION_WNM;
- mgmt->u.action.u.bss_tm_req.action = WNM_BSS_TRANS_MGMT_REQ;
-- mgmt->u.action.u.bss_tm_req.dialog_token = 1;
-+ mgmt->u.action.u.bss_tm_req.dialog_token = dialog_token;
- mgmt->u.action.u.bss_tm_req.req_mode = req_mode;
- mgmt->u.action.u.bss_tm_req.disassoc_timer =
- host_to_le16(disassoc_timer);
---- a/src/ap/wnm_ap.h
-+++ b/src/ap/wnm_ap.h
-@@ -20,8 +20,8 @@ int wnm_send_ess_disassoc_imminent(struc
- int disassoc_timer);
- int wnm_send_bss_tm_req(struct hostapd_data *hapd, struct sta_info *sta,
- u8 req_mode, int disassoc_timer, u8 valid_int,
-- const u8 *bss_term_dur, const char *url,
-- const u8 *nei_rep, size_t nei_rep_len,
-+ const u8 *bss_term_dur, u8 dialog_token,
-+ const char *url, const u8 *nei_rep, size_t nei_rep_len,
- const u8 *mbo_attrs, size_t mbo_len);
- void ap_sta_reset_steer_flag_timer(void *eloop_ctx, void *timeout_ctx);
- int wnm_send_coloc_intf_req(struct hostapd_data *hapd, struct sta_info *sta,
diff --git a/package/network/services/hostapd/patches/720-ACS-fix-channel-100-frequency.patch b/package/network/services/hostapd/patches/720-ACS-fix-channel-100-frequency.patch
deleted file mode 100644
index 3ef19e5298..0000000000
--- a/package/network/services/hostapd/patches/720-ACS-fix-channel-100-frequency.patch
+++ /dev/null
@@ -1,30 +0,0 @@
-From 5a24286ed6315e1fef755ca1970792554f59b1fc Mon Sep 17 00:00:00 2001
-From: David Bauer <mail@david-bauer.net>
-Date: Wed, 26 May 2021 22:15:35 +0200
-Subject: [PATCH] ACS: fix channel 100 frequency
-
-Channel 100 is a valid channel to choose for 80MHz operation. However,
-it's assigned to 5500 MHz, not 5550MHz. In fact, there is no channel
-assigned to this frequency.
-
-Fix this obbvious typo to allow ACS to select channel 100 for 80 MHz
-operation again.
-
-Fixes commit bef5eee4f7b2 ("Convert channel to frequency based selection for AP mode ACS")
-
-Signed-off-by: David Bauer <mail@david-bauer.net>
----
- src/ap/acs.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
---- a/src/ap/acs.c
-+++ b/src/ap/acs.c
-@@ -386,7 +386,7 @@ static int acs_usable_bw40_chan(const st
-
- static int acs_usable_bw80_chan(const struct hostapd_channel_data *chan)
- {
-- const int allowed[] = { 5180, 5260, 5550, 5580, 5660, 5745, 5955, 6035,
-+ const int allowed[] = { 5180, 5260, 5500, 5580, 5660, 5745, 5955, 6035,
- 6115, 6195, 6275, 6355, 6435, 6515, 6595, 6675,
- 6755, 6835, 6915, 6995 };
- unsigned int i;
diff --git a/package/network/services/hostapd/patches/741-proxyarp-fix-compilation-with-Hotspot-2.0-disabled.patch b/package/network/services/hostapd/patches/741-proxyarp-fix-compilation-with-Hotspot-2.0-disabled.patch
deleted file mode 100644
index 657ef5f2ed..0000000000
--- a/package/network/services/hostapd/patches/741-proxyarp-fix-compilation-with-Hotspot-2.0-disabled.patch
+++ /dev/null
@@ -1,51 +0,0 @@
-From ad694836b2ded6b97b426bf331627537cdbff591 Mon Sep 17 00:00:00 2001
-From: David Bauer <mail@david-bauer.net>
-Date: Thu, 19 Aug 2021 00:52:04 +0200
-Subject: [PATCH] proxyarp: fix compilation with Hotspot 2.0 disabled
-
-The disable_dgaf config fiels is only available in case Hostapd is
-compiled with Hotspot 2.0 support, however Proxy-ARP does not depend on
-Hotspot 2.0.
-
-Only add the code related to this config field when Hotspot 2.0 is
-enabled to fix compilation with the aformentioned preconditions.
-
-Signed-off-by: David Bauer <mail@david-bauer.net>
----
- src/ap/dhcp_snoop.c | 2 ++
- src/ap/ndisc_snoop.c | 2 ++
- 2 files changed, 4 insertions(+)
-
---- a/src/ap/dhcp_snoop.c
-+++ b/src/ap/dhcp_snoop.c
-@@ -88,6 +88,7 @@ static void handle_dhcp(void *ctx, const
- }
- }
-
-+#ifdef CONFIG_HS20
- if (hapd->conf->disable_dgaf && is_broadcast_ether_addr(buf)) {
- for (sta = hapd->sta_list; sta; sta = sta->next) {
- if (!(sta->flags & WLAN_STA_AUTHORIZED))
-@@ -96,6 +97,7 @@ static void handle_dhcp(void *ctx, const
- (u8 *) buf, len);
- }
- }
-+#endif
-
- if (msgtype == DHCPACK) {
- if (b->your_ip == 0)
---- a/src/ap/ndisc_snoop.c
-+++ b/src/ap/ndisc_snoop.c
-@@ -151,10 +151,12 @@ static void handle_ndisc(void *ctx, cons
- return;
- }
- break;
-+#ifdef CONFIG_HS20
- case ROUTER_ADVERTISEMENT:
- if (hapd->conf->disable_dgaf)
- ucast_to_stas(hapd, buf, len);
- break;
-+#endif
- case NEIGHBOR_ADVERTISEMENT:
- if (hapd->conf->na_mcast_to_ucast)
- ucast_to_stas(hapd, buf, len);
diff --git a/package/network/services/hostapd/src/src/ap/ubus.c b/package/network/services/hostapd/src/src/ap/ubus.c
index 5855b25794..fdc2a3fd26 100644
--- a/package/network/services/hostapd/src/src/ap/ubus.c
+++ b/package/network/services/hostapd/src/src/ap/ubus.c
@@ -1229,7 +1229,7 @@ hostapd_rrm_nr_set(struct ubus_context *ctx, struct ubus_object *obj,
memcpy(&ssid, s, ssid.ssid_len);
}
- hostapd_neighbor_set(hapd, bssid, &ssid, data, NULL, NULL, 0);
+ hostapd_neighbor_set(hapd, bssid, &ssid, data, NULL, NULL, 0, 0);
wpabuf_free(data);
continue;