Compare commits

..

8 Commits

Author SHA1 Message Date
Ramon Moesching 152e1f2fd9 wpa_supplicant-full.config: do not use libnl-tiny
Signed-off-by: Ramon Moesching <ramon.moesching@netmodule.com>
2020-10-21 10:08:35 +02:00
Ramon Moesching d41ef73943 hostapd-full.config: do not use libnl-tiny
Signed-off-by: Ramon Moesching <ramon.moesching@netmodule.com>
2020-10-21 10:07:54 +02:00
Ramon Moesching 84f10e388a hostapd.inc: use libnl version and dbus
Signed-off-by: Ramon Moesching <ramon.moesching@netmodule.com>
2020-10-21 10:07:20 +02:00
Ramon Moesching ab31e173ba iw: get rid of tiny version of libnl
Signed-off-by: Ramon Moesching <ramon.moesching@netmodule.com>
2020-10-21 10:03:35 +02:00
Ramon Moesching e8154575f3 mac80211: fix wrong FLEX usage
Signed-off-by: Ramon Moesching <ramon.moesching@netmodule.com>
2020-10-21 09:54:21 +02:00
Ramon Moesching ff480c20b9 mac80211: apply config in recipe
Signed-off-by: Ramon Moesching <ramon.moesching@netmodule.com>
2020-10-21 09:53:57 +02:00
Ramon Moesching d45604b831 mac80211: add config
Signed-off-by: Ramon Moesching <ramon.moesching@netmodule.com>
2020-10-21 09:52:27 +02:00
Ramon Moesching 750f898072 layer.conf: increase layer priority
Higher than standard netmodule layers like bsp

Signed-off-by: Ramon Moesching <ramon.moesching@netmodule.com>
2020-10-21 09:17:35 +02:00
125 changed files with 10633 additions and 34258 deletions

View File

@ -1,7 +0,0 @@
# NetModule WLAN Layer
![badge](https://badgen.net/badge/meta-netmodule-wlan/deprecated/red)
This instance of the Meta NM WLAN layer is **deprecated**
This project has been moved to [bitbucket](https://bitbucket.gad.local/projects/NM-NSP/repos/meta-netmodule-wlan/browse).

View File

@ -13,4 +13,4 @@ BBFILE_PRIORITY_netmodule-wlan = "11"
# cause compatibility issues with other layers
LAYERVERSION_netmodule-wlan = "1"
LAYERSERIES_COMPAT_netmodule-wlan = "warrior dunfell"
LAYERSERIES_COMPAT_netmodule-wlan = "warrior"

View File

@ -1,4 +1,4 @@
From 8f5d84d19c5a022157d62a34c320d478f7e7ab8c Mon Sep 17 00:00:00 2001
From 1410d96b1ffefbf4ba3dfb3d432db7c9558a8386 Mon Sep 17 00:00:00 2001
From: Moritz Rosenthal <moritz.rosenthal@netmodule.com>
Date: Sat, 29 Feb 2020 21:13:42 +0100
Subject: [PATCH] Add build artifact build_features.h to gitignore
@ -8,11 +8,11 @@ Subject: [PATCH] Add build artifact build_features.h to gitignore
1 file changed, 1 insertion(+)
diff --git a/.gitignore b/.gitignore
index b064303ce..435e9e19d 100644
index 6a985a75d..dd6bf9291 100644
--- a/.gitignore
+++ b/.gitignore
@@ -6,3 +6,4 @@ wpaspy/build
@@ -33,3 +33,4 @@ wlantest/test_vectors
wlantest/wlantest
wlantest/wlantest_cli
**/parallel-vm.log
tags
build/
+src/utils/build_features.h

View File

@ -1,26 +0,0 @@
From 45bf83dbe2a84f39f09a247445531d890655ea2b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=BCrgen=20Henke?= <juergen.henke@netmodule.com>
Date: Thu, 11 Nov 2021 09:05:57 +0100
Subject: [PATCH] fix: create a versioned shared library libwlan_client.so
Otherwise we will run circles around oe's "THOU SHALL NOT USED
UNVERSIONED LIBRARIES IN THY LORD'S ROOT-FS" feature.
BugzId: 75694
---
wpa_supplicant/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/wpa_supplicant/Makefile b/wpa_supplicant/Makefile
index 5f5f049ae..1a41c1209 100644
--- a/wpa_supplicant/Makefile
+++ b/wpa_supplicant/Makefile
@@ -2003,7 +2003,7 @@ libwpa_client.a: $(LIBCTRL)
libwpa_client.so: $(LIBCTRLSO)
@$(E) " CC $@ ($^)"
- $(Q)$(CC) $(LDFLAGS) -o $@ $(CFLAGS) -shared -fPIC $^
+ $(Q)$(CC) $(LDFLAGS) -o $@ $(CFLAGS) -shared -Wl,-soname,libwpa_client.so.$(WPAPV) -fPIC $^
OBJS_wpatest := libwpa_test.o
_OBJS_VAR := OBJS_wpatest

View File

@ -1,49 +0,0 @@
From 6cb306fef195a430642a2475d72fcc6b375acb11 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=BCrgen=20Henke?= <juergen.henke@netmodule.com>
Date: Mon, 21 Feb 2022 15:40:04 +0100
Subject: [PATCH] use nas-port-type ethernet for wired 802.1X
- if the driver is "wired", use nas-port type "ethernet", otherwise
use "wirless-802.1X" as before.
BugzId: 78385
---
src/ap/ieee802_1x.c | 9 +++++++--
src/radius/radius.h | 1 +
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/src/ap/ieee802_1x.c b/src/ap/ieee802_1x.c
index 9ee99cff3..8a012a9e4 100644
--- a/src/ap/ieee802_1x.c
+++ b/src/ap/ieee802_1x.c
@@ -578,11 +578,16 @@ int add_common_radius_attr(struct hostapd_data *hapd,
return -1;
}
+ int32_t nas_port_type = RADIUS_NAS_PORT_TYPE_IEEE_802_11;
+ if (os_strcmp(hapd->driver->name,"wired") == 0) {
+ // wired ports need a different port type:
+ nas_port_type = RADIUS_NAS_PORT_TYPE_ETHERNET;
+ }
if (!hostapd_config_get_radius_attr(req_attr,
RADIUS_ATTR_NAS_PORT_TYPE) &&
!radius_msg_add_attr_int32(msg, RADIUS_ATTR_NAS_PORT_TYPE,
- RADIUS_NAS_PORT_TYPE_IEEE_802_11)) {
- wpa_printf(MSG_ERROR, "Could not add NAS-Port-Type");
+ nas_port_type)) {
+ wpa_printf(MSG_ERROR, "Could not add NAS-Port-Type (%i)", nas_port_type);
return -1;
}
diff --git a/src/radius/radius.h b/src/radius/radius.h
index 630c0f9d0..a6056d8bd 100644
--- a/src/radius/radius.h
+++ b/src/radius/radius.h
@@ -125,6 +125,7 @@ enum { RADIUS_ATTR_USER_NAME = 1,
/* NAS-Port-Type */
#define RADIUS_NAS_PORT_TYPE_IEEE_802_11 19
+#define RADIUS_NAS_PORT_TYPE_ETHERNET 15
/* Acct-Status-Type */
#define RADIUS_ACCT_STATUS_TYPE_START 1

View File

@ -1,4 +1,4 @@
From c1bd2dd68e6c55767cf39e65f841c80c696ff7ae Mon Sep 17 00:00:00 2001
From 919318e4abd51df15dd4d5769ed2d0ad6981e87b Mon Sep 17 00:00:00 2001
From: Moritz Rosenthal <moritz.rosenthal@netmodule.com>
Date: Sat, 29 Feb 2020 21:17:05 +0100
Subject: [PATCH] Use environment variable EXTRA_CFLAGS
@ -8,15 +8,15 @@ Subject: [PATCH] Use environment variable EXTRA_CFLAGS
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/lib.rules b/src/lib.rules
index 947617b07..ffdfc5c8d 100644
index a46315442..3eb721a6d 100644
--- a/src/lib.rules
+++ b/src/lib.rules
@@ -10,7 +10,7 @@ CFLAGS += -DTEST_FUZZ
@@ -3,7 +3,7 @@ CC=gcc
endif
CFLAGS += $(FUZZ_CFLAGS)
-CFLAGS += -I.. -I../utils
+CFLAGS += -I.. -I../utils $(EXTRA_CFLAGS)
ifndef CFLAGS
-CFLAGS = -MMD -O2 -Wall -g
+CFLAGS = -MMD -O2 -Wall -g $(EXTRA_CFLAGS)
endif
_OBJS_VAR := LIB_OBJS
include ../objs.mk
ifdef TEST_FUZZ

View File

@ -1,46 +0,0 @@
From ae4dbb9e7a3f94a143b9a18e124773a7cb52589b Mon Sep 17 00:00:00 2001
From: David Bauer <mail@david-bauer.net>
Date: Wed, 5 May 2021 00:44:34 +0200
Subject: [PATCH] wolfssl: add RNG to EC key
Since upstream commit 6467de5a8840 ("Randomize z ordinates in
scalar mult when timing resistant") WolfSSL requires a RNG for
the EC key when built hardened which is the default.
Set the RNG for the EC key to fix connections for OWE clients.
Signed-off-by: David Bauer <mail@david-bauer.net>
---
src/crypto/crypto_wolfssl.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/crypto/crypto_wolfssl.c b/src/crypto/crypto_wolfssl.c
index f47beebeb..a28349b66 100644
--- a/src/crypto/crypto_wolfssl.c
+++ b/src/crypto/crypto_wolfssl.c
@@ -1340,6 +1340,7 @@ int ecc_projective_add_point(ecc_point *P, ecc_point *Q, ecc_point *R,
struct crypto_ec {
ecc_key key;
+ WC_RNG rng;
mp_int a;
mp_int prime;
mp_int order;
@@ -1394,6 +1395,8 @@ struct crypto_ec * crypto_ec_init(int group)
return NULL;
if (wc_ecc_init(&e->key) != 0 ||
+ wc_InitRng(&e->rng) != 0 ||
+ wc_ecc_set_rng(&e->key, &e->rng) != 0 ||
wc_ecc_set_curve(&e->key, 0, curve_id) != 0 ||
mp_init(&e->a) != MP_OKAY ||
mp_init(&e->prime) != MP_OKAY ||
@@ -1425,6 +1428,7 @@ void crypto_ec_deinit(struct crypto_ec* e)
mp_clear(&e->order);
mp_clear(&e->prime);
mp_clear(&e->a);
+ wc_FreeRng(&e->rng);
wc_ecc_free(&e->key);
os_free(e);
}

View File

@ -0,0 +1,129 @@
From be22439f78de79cfbaa12c56f28d1f46bfe46eb3 Mon Sep 17 00:00:00 2001
From: Peter Oh <peter.oh@bowerswilkins.com>
Date: Mon, 27 Aug 2018 14:28:38 -0700
Subject: [PATCH] mesh: use setup completion callback to complete mesh join
mesh join function is the last function to be called during
mesh join process, but it's been called a bit earlier than
it's supposed to be, so that some mesh parameter values
such as VHT capabilities not applied correct when mesh join
is in process.
Moreover current design of mesh join that is called directly
after mesh initialization isn't suitable for DFS channels to use,
since mesh join process should be paused until DFS CAC is
done and resumed after it's done.
The callback will be called by hostapd_setup_interface_complete_sync.
There is possiblity that completing mesh init fails, so add error
handle codes.
Signed-off-by: Peter Oh <peter.oh@bowerswilkins.com>
Signed-off-by: Peter Oh <peter.oh@bowerswilkins.com>
---
src/ap/hostapd.c | 11 ++++++++++-
wpa_supplicant/mesh.c | 13 +++++++------
2 files changed, 17 insertions(+), 7 deletions(-)
diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c
index bf1975fbd..c85563353 100644
--- a/src/ap/hostapd.c
+++ b/src/ap/hostapd.c
@@ -423,6 +423,8 @@ static void hostapd_free_hapd_data(struct hostapd_data *hapd)
#ifdef CONFIG_MESH
wpabuf_free(hapd->mesh_pending_auth);
hapd->mesh_pending_auth = NULL;
+ /* handling setup failure is already done */
+ hapd->setup_complete_cb = NULL;
#endif /* CONFIG_MESH */
hostapd_clean_rrm(hapd);
@@ -2049,6 +2051,13 @@ dfs_offload:
if (hapd->setup_complete_cb)
hapd->setup_complete_cb(hapd->setup_complete_cb_ctx);
+#ifdef CONFIG_MESH
+ if (delay_apply_cfg && !iface->mconf) {
+ wpa_printf(MSG_ERROR, "Error while completing mesh init");
+ goto fail;
+ }
+#endif /* CONFIG_MESH */
+
wpa_printf(MSG_DEBUG, "%s: Setup of interface done.",
iface->bss[0]->conf->iface);
if (iface->interfaces && iface->interfaces->terminate_on_error > 0)
@@ -2192,7 +2201,7 @@ int hostapd_setup_interface(struct hostapd_iface *iface)
ret = setup_interface(iface);
if (ret) {
wpa_printf(MSG_ERROR, "%s: Unable to setup interface.",
- iface->bss[0]->conf->iface);
+ iface->conf ? iface->conf->bss[0]->iface : "N/A");
return -1;
}
diff --git a/wpa_supplicant/mesh.c b/wpa_supplicant/mesh.c
index 7354c1b79..4099cbe29 100644
--- a/wpa_supplicant/mesh.c
+++ b/wpa_supplicant/mesh.c
@@ -190,8 +190,9 @@ static int wpas_mesh_init_rsn(struct wpa_supplicant *wpa_s)
}
-static int wpas_mesh_complete(struct wpa_supplicant *wpa_s)
+static void wpas_mesh_complete_cb(void *ctx)
{
+ struct wpa_supplicant *wpa_s = ctx;
struct hostapd_iface *ifmsh = wpa_s->ifmsh;
struct wpa_driver_mesh_join_params *params = wpa_s->mesh_params;
struct wpa_ssid *ssid = wpa_s->current_ssid;
@@ -200,7 +201,7 @@ static int wpas_mesh_complete(struct wpa_supplicant *wpa_s)
if (!params || !ssid || !ifmsh) {
wpa_printf(MSG_ERROR, "mesh: %s called without active mesh",
__func__);
- return -1;
+ return;
}
if (ifmsh->mconf->security != MESH_CONF_SEC_NONE &&
@@ -209,7 +210,7 @@ static int wpas_mesh_complete(struct wpa_supplicant *wpa_s)
"mesh: RSN initialization failed - deinit mesh");
wpa_supplicant_mesh_deinit(wpa_s);
wpa_drv_leave_mesh(wpa_s);
- return -1;
+ return;
}
if (ssid->key_mgmt & WPA_KEY_MGMT_SAE) {
@@ -235,8 +236,6 @@ static int wpas_mesh_complete(struct wpa_supplicant *wpa_s)
if (!ret)
wpa_supplicant_set_state(wpa_s, WPA_COMPLETED);
-
- return ret;
}
@@ -263,6 +262,7 @@ static int wpa_supplicant_mesh_init(struct wpa_supplicant *wpa_s,
if (!ifmsh)
return -ENOMEM;
+ ifmsh->owner = wpa_s;
ifmsh->drv_flags = wpa_s->drv_flags;
ifmsh->num_bss = 1;
ifmsh->bss = os_calloc(wpa_s->ifmsh->num_bss,
@@ -280,6 +280,8 @@ static int wpa_supplicant_mesh_init(struct wpa_supplicant *wpa_s,
bss->drv_priv = wpa_s->drv_priv;
bss->iface = ifmsh;
bss->mesh_sta_free_cb = mesh_mpm_free_sta;
+ bss->setup_complete_cb = wpas_mesh_complete_cb;
+ bss->setup_complete_cb_ctx = wpa_s;
frequency = ssid->frequency;
if (frequency != freq->freq &&
frequency == freq->freq + freq->sec_channel_offset * 20) {
@@ -521,7 +523,6 @@ int wpa_supplicant_join_mesh(struct wpa_supplicant *wpa_s,
goto out;
}
- ret = wpas_mesh_complete(wpa_s);
out:
return ret;
}

View File

@ -0,0 +1,29 @@
From ca681f3655d80bd3cc3a2876847992bd6c6ddf35 Mon Sep 17 00:00:00 2001
From: Peter Oh <peter.oh@bowerswilkins.com>
Date: Mon, 27 Aug 2018 14:28:41 -0700
Subject: [PATCH] mesh: update ssid->frequency as pri/sec channel switch
ssid->frequency is one of variables used to gets channel
number from given frequency. Leave it as unchanged when
pri/sec channel switched will cause picking up wrong
channel number after applying secondary channel offset
for HT40 and leads failing interface bring-up.
Signed-off-by: Peter Oh <peter.oh@bowerswilkins.com>
---
wpa_supplicant/mesh.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/wpa_supplicant/mesh.c b/wpa_supplicant/mesh.c
index 4099cbe29..3cb2b2c38 100644
--- a/wpa_supplicant/mesh.c
+++ b/wpa_supplicant/mesh.c
@@ -287,6 +287,7 @@ static int wpa_supplicant_mesh_init(struct wpa_supplicant *wpa_s,
frequency == freq->freq + freq->sec_channel_offset * 20) {
wpa_printf(MSG_DEBUG, "mesh: pri/sec channels switched");
frequency = freq->freq;
+ ssid->frequency = frequency;
}
wpa_s->assoc_freq = frequency;
wpa_s->current_ssid = ssid;

View File

@ -0,0 +1,55 @@
From 8db674b0500f4e7daa2771fceac8fdff162ae0b6 Mon Sep 17 00:00:00 2001
From: Peter Oh <peter.oh@bowerswilkins.com>
Date: Mon, 27 Aug 2018 14:28:49 -0700
Subject: [PATCH] mesh: inform kernel driver DFS handler in userspace
NL80211_ATTR_HANDLE_DFS is required by kerenel space
to enable DFS channels that indicates DFS handler
resides in userspace.
Signed-off-by: Peter Oh <peter.oh@bowerswilkins.com>
---
src/drivers/driver.h | 1 +
src/drivers/driver_nl80211.c | 3 +++
wpa_supplicant/mesh.c | 1 +
3 files changed, 5 insertions(+)
diff --git a/src/drivers/driver.h b/src/drivers/driver.h
index 2a8459ae3..3c92fb76c 100644
--- a/src/drivers/driver.h
+++ b/src/drivers/driver.h
@@ -1477,6 +1477,7 @@ struct wpa_driver_mesh_join_params {
#define WPA_DRIVER_MESH_FLAG_SAE_AUTH 0x00000004
#define WPA_DRIVER_MESH_FLAG_AMPE 0x00000008
unsigned int flags;
+ u8 handle_dfs;
};
/**
diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
index 0a356eefd..6764ba9df 100644
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
@@ -9624,6 +9624,9 @@ static int nl80211_join_mesh(struct i802_bss *bss,
wpa_printf(MSG_DEBUG, " * flags=%08X", params->flags);
+ if (params->handle_dfs)
+ if (nla_put_flag(msg, NL80211_ATTR_HANDLE_DFS))
+ goto fail;
container = nla_nest_start(msg, NL80211_ATTR_MESH_SETUP);
if (!container)
goto fail;
diff --git a/wpa_supplicant/mesh.c b/wpa_supplicant/mesh.c
index 3cb2b2c38..36ff2df89 100644
--- a/wpa_supplicant/mesh.c
+++ b/wpa_supplicant/mesh.c
@@ -309,6 +309,7 @@ static int wpa_supplicant_mesh_init(struct wpa_supplicant *wpa_s,
conf->country[0] = wpa_s->conf->country[0];
conf->country[1] = wpa_s->conf->country[1];
conf->country[2] = ' ';
+ wpa_s->mesh_params->handle_dfs = 1;
}
bss->iconf = conf;

View File

@ -0,0 +1,50 @@
From 912990afa5f72947d5e2cfc21e88e5288a1116d6 Mon Sep 17 00:00:00 2001
From: Peter Oh <peter.oh@bowerswilkins.com>
Date: Mon, 27 Aug 2018 14:28:40 -0700
Subject: [PATCH] mesh: Apply channel attributes before setup interface
This helps mesh interface initialization with correct channel
parameters.
Signed-off-by: Peter Oh <peter.oh@bowerswilkins.com>
---
wpa_supplicant/mesh.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/wpa_supplicant/mesh.c b/wpa_supplicant/mesh.c
index 36ff2df89..98b041380 100644
--- a/wpa_supplicant/mesh.c
+++ b/wpa_supplicant/mesh.c
@@ -249,7 +249,7 @@ static int wpa_supplicant_mesh_init(struct wpa_supplicant *wpa_s,
struct mesh_conf *mconf;
int basic_rates_erp[] = { 10, 20, 55, 60, 110, 120, 240, -1 };
int rate_len;
- int frequency;
+ int frequency, saved_freq;
if (!wpa_s->conf->user_mpm) {
/* not much for us to do here */
@@ -386,6 +386,13 @@ static int wpa_supplicant_mesh_init(struct wpa_supplicant *wpa_s,
conf->basic_rates[rate_len] = -1;
}
+ /* Handle pri/sec switch frequency within AP configuration parameter
+ * generation without changing the stored network profile in the end. */
+ saved_freq = ssid->frequency;
+ ssid->frequency = frequency;
+ wpa_supplicant_conf_ap_ht(wpa_s, ssid, conf);
+ ssid->frequency = saved_freq;
+
if (wpa_drv_init_mesh(wpa_s)) {
wpa_msg(wpa_s, MSG_ERROR, "Failed to init mesh in driver");
return -1;
@@ -397,8 +404,6 @@ static int wpa_supplicant_mesh_init(struct wpa_supplicant *wpa_s,
return -1;
}
- wpa_supplicant_conf_ap_ht(wpa_s, ssid, conf);
-
return 0;
out_free:
wpa_supplicant_mesh_deinit(wpa_s);

View File

@ -1,108 +0,0 @@
From 4b6c9580dae47d20f429f0e2738183969acf29b8 Mon Sep 17 00:00:00 2001
From: Peter Oh <peter.oh@bowerswilkins.com>
Date: Tue, 30 Jun 2020 14:18:58 +0200
Subject: [PATCH] mesh: Allow DFS channels to be selected if dfs is enabled
Note: DFS is assumed to be usable if a country code has been set
Signed-off-by: Benjamin Berg <benjamin@sipsolutions.net>
Signed-off-by: Peter Oh <peter.oh@bowerswilkins.com>
---
wpa_supplicant/wpa_supplicant.c | 31 ++++++++++++++++++++++---------
1 file changed, 22 insertions(+), 9 deletions(-)
diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c
index cf68417ca..fb47942c9 100644
--- a/wpa_supplicant/wpa_supplicant.c
+++ b/wpa_supplicant/wpa_supplicant.c
@@ -2425,7 +2425,7 @@ static int drv_supports_vht(struct wpa_supplicant *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;
@@ -2434,7 +2434,10 @@ static bool ibss_mesh_is_80mhz_avail(int channel, struct hostapd_hw_modes *mode)
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;
}
@@ -2463,6 +2466,8 @@ void ibss_mesh_setup_freq(struct wpa_supplicant *wpa_s,
int chwidth, seg0, seg1;
u32 vht_caps = 0;
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;
@@ -2559,8 +2564,11 @@ void ibss_mesh_setup_freq(struct wpa_supplicant *wpa_s,
return;
/* Check primary channel flags */
- if (pri_chan->flag & (HOSTAPD_CHAN_DISABLED | HOSTAPD_CHAN_NO_IR))
+ if (pri_chan->flag & HOSTAPD_CHAN_DISABLED)
return;
+ if (pri_chan->flag & (HOSTAPD_CHAN_RADAR | HOSTAPD_CHAN_NO_IR))
+ if (!dfs_enabled)
+ return;
freq->channel = pri_chan->chan;
@@ -2593,8 +2601,11 @@ void ibss_mesh_setup_freq(struct wpa_supplicant *wpa_s,
return;
/* Check secondary channel flags */
- if (sec_chan->flag & (HOSTAPD_CHAN_DISABLED | HOSTAPD_CHAN_NO_IR))
+ if (sec_chan->flag & HOSTAPD_CHAN_DISABLED)
return;
+ if (sec_chan->flag & (HOSTAPD_CHAN_RADAR | HOSTAPD_CHAN_NO_IR))
+ if (!dfs_enabled)
+ return;
if (ht40 == -1) {
if (!(pri_chan->flag & HOSTAPD_CHAN_HT40MINUS))
@@ -2683,7 +2694,7 @@ skip_to_6ghz:
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;
@@ -2697,7 +2708,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++) {
@@ -2727,10 +2738,12 @@ skip_to_6ghz:
if (!chan)
continue;
- if (chan->flag & (HOSTAPD_CHAN_DISABLED |
- HOSTAPD_CHAN_NO_IR |
- HOSTAPD_CHAN_RADAR))
+ if (chan->flag & HOSTAPD_CHAN_DISABLED)
continue;
+ if (chan->flag & (HOSTAPD_CHAN_RADAR |
+ HOSTAPD_CHAN_NO_IR))
+ if (!dfs_enabled)
+ continue;
/* Found a suitable second segment for 80+80 */
chwidth = CHANWIDTH_80P80MHZ;

View File

@ -0,0 +1,81 @@
From 6d8777f93943b633580ce25b4ce46cab9f226e41 Mon Sep 17 00:00:00 2001
From: Peter Oh <peter.oh@bowerswilkins.com>
Date: Mon, 27 Aug 2018 14:28:45 -0700
Subject: [PATCH] mesh: Allow DFS channels to be selected if dfs is enabled
Note: DFS is assumed to be usable if a country code has been set
Signed-off-by: Benjamin Berg <benjamin@sipsolutions.net>
Signed-off-by: Peter Oh <peter.oh@bowerswilkins.com>
---
wpa_supplicant/wpa_supplicant.c | 24 ++++++++++++++++++------
1 file changed, 18 insertions(+), 6 deletions(-)
diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c
index 911d79d17..578f274a9 100644
--- a/wpa_supplicant/wpa_supplicant.c
+++ b/wpa_supplicant/wpa_supplicant.c
@@ -2153,6 +2153,8 @@ void ibss_mesh_setup_freq(struct wpa_supplicant *wpa_s,
struct hostapd_freq_params vht_freq;
int chwidth, seg0, seg1;
u32 vht_caps = 0;
+ int dfs_enabled = wpa_s->conf->country[0] &&
+ (wpa_s->drv_flags & WPA_DRIVER_FLAGS_RADAR);
freq->freq = ssid->frequency;
@@ -2232,8 +2234,11 @@ void ibss_mesh_setup_freq(struct wpa_supplicant *wpa_s,
return;
/* Check primary channel flags */
- if (pri_chan->flag & (HOSTAPD_CHAN_DISABLED | HOSTAPD_CHAN_NO_IR))
+ if (pri_chan->flag & HOSTAPD_CHAN_DISABLED)
return;
+ if (pri_chan->flag & (HOSTAPD_CHAN_RADAR | HOSTAPD_CHAN_NO_IR))
+ if (!dfs_enabled)
+ return;
freq->channel = pri_chan->chan;
@@ -2264,8 +2269,11 @@ void ibss_mesh_setup_freq(struct wpa_supplicant *wpa_s,
return;
/* Check secondary channel flags */
- if (sec_chan->flag & (HOSTAPD_CHAN_DISABLED | HOSTAPD_CHAN_NO_IR))
+ if (sec_chan->flag & HOSTAPD_CHAN_DISABLED)
return;
+ if (sec_chan->flag & (HOSTAPD_CHAN_RADAR | HOSTAPD_CHAN_NO_IR))
+ if (!dfs_enabled)
+ return;
if (ht40 == -1) {
if (!(pri_chan->flag & HOSTAPD_CHAN_HT40MINUS))
@@ -2356,8 +2364,11 @@ skip_ht40:
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;
}
chwidth = CHANWIDTH_80MHZ;
@@ -2377,10 +2388,11 @@ skip_ht40:
if (!chan)
continue;
- if (chan->flag & (HOSTAPD_CHAN_DISABLED |
- HOSTAPD_CHAN_NO_IR |
- HOSTAPD_CHAN_RADAR))
+ if (chan->flag & HOSTAPD_CHAN_DISABLED)
continue;
+ if (chan->flag & (HOSTAPD_CHAN_RADAR | HOSTAPD_CHAN_NO_IR))
+ if (!dfs_enabled)
+ continue;
/* Found a suitable second segment for 80+80 */
chwidth = CHANWIDTH_80P80MHZ;

View File

@ -1,86 +0,0 @@
From 1165051d5d5d32340384a6e10f73fa763530aac9 Mon Sep 17 00:00:00 2001
From: Markus Theil <markus.theil@tu-ilmenau.de>
Date: Tue, 30 Jun 2020 14:19:07 +0200
Subject: [PATCH] mesh: use deterministic channel on channel switch
This patch uses a deterministic channel on DFS channel switch
in mesh networks. Otherwise, when switching to a usable but not
available channel, no CSA can be sent and a random channel is choosen
without notification of other nodes. It is then quite likely, that
the mesh network gets disconnected.
Fix this by using a deterministic number, based on the sha256 hash
of the mesh ID, in order to use at least a different number in each
mesh network.
Signed-off-by: Markus Theil <markus.theil@tu-ilmenau.de>
---
src/ap/dfs.c | 20 +++++++++++++++++++-
src/drivers/driver_nl80211.c | 4 ++++
2 files changed, 23 insertions(+), 1 deletion(-)
diff --git a/src/ap/dfs.c b/src/ap/dfs.c
index e46dd7ede..5a0d3497d 100644
--- a/src/ap/dfs.c
+++ b/src/ap/dfs.c
@@ -17,6 +17,7 @@
#include "ap_drv_ops.h"
#include "drivers/driver.h"
#include "dfs.h"
+#include "crypto/crypto.h"
enum dfs_channel_type {
@@ -515,9 +516,14 @@ dfs_get_valid_channel(struct hostapd_iface *iface,
int num_available_chandefs;
int chan_idx, chan_idx2;
int sec_chan_idx_80p80 = -1;
+ bool is_mesh = false;
int i;
u32 _rand;
+#ifdef CONFIG_MESH
+ is_mesh = iface->mconf;
+#endif
+
wpa_printf(MSG_DEBUG, "DFS: Selecting random channel");
*secondary_channel = 0;
*oper_centr_freq_seg0_idx = 0;
@@ -537,8 +543,20 @@ dfs_get_valid_channel(struct hostapd_iface *iface,
if (num_available_chandefs == 0)
return NULL;
- if (os_get_random((u8 *) &_rand, sizeof(_rand)) < 0)
+ /* try to use deterministic channel in mesh, so that both sides
+ * have a chance to switch to the same channel */
+ if (is_mesh) {
+#ifdef CONFIG_MESH
+ u64 hash[4];
+ const u8 *meshid[1] = { &iface->mconf->meshid[0] };
+ const size_t meshid_len = iface->mconf->meshid_len;
+
+ sha256_vector(1, meshid, &meshid_len, (u8 *)&hash[0]);
+ _rand = hash[0] + hash[1] + hash[2] + hash[3];
+#endif
+ } else if (os_get_random((u8 *) &_rand, sizeof(_rand)) < 0)
return NULL;
+
chan_idx = _rand % num_available_chandefs;
dfs_find_channel(iface, &chan, chan_idx, type);
if (!chan) {
diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
index 60e44a1a9..d62d685f4 100644
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
@@ -9932,6 +9932,10 @@ static int nl80211_switch_channel(void *priv, struct csa_settings *settings)
if (ret)
goto error;
+ if (drv->nlmode == NL80211_IFTYPE_MESH_POINT) {
+ nla_put_flag(msg, NL80211_ATTR_HANDLE_DFS);
+ }
+
/* beacon_csa params */
beacon_csa = nla_nest_start(msg, NL80211_ATTR_CSA_IES);
if (!beacon_csa)

View File

@ -0,0 +1,32 @@
From d9b002241024bcbfeb4d5adf413ff712bc0aa978 Mon Sep 17 00:00:00 2001
From: Peter Oh <peter.oh@bowerswilkins.com>
Date: Mon, 27 Aug 2018 14:28:48 -0700
Subject: [PATCH] mesh: don't allow pri/sec channel switch
This limitation isn't backed by standard, but it is known that
mesh doesn't have capability to handle 20/40 coex change in
current implementation and it will not able to establish
PLINK when channel switch between primary and secondary happens.
Since it's unknown when we will have the implementation of handling
20/40 coex change for mesh, it'd better to avoid them from happening
until standard based implementation is introduced.
Signed-off-by: Peter Oh <peter.oh@bowerswilkins.com>
---
wpa_supplicant/mesh.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/wpa_supplicant/mesh.c b/wpa_supplicant/mesh.c
index 98b041380..f4b62a8fd 100644
--- a/wpa_supplicant/mesh.c
+++ b/wpa_supplicant/mesh.c
@@ -386,6 +386,7 @@ static int wpa_supplicant_mesh_init(struct wpa_supplicant *wpa_s,
conf->basic_rates[rate_len] = -1;
}
+ conf->no_pri_sec_switch = 1;
/* Handle pri/sec switch frequency within AP configuration parameter
* generation without changing the stored network profile in the end. */
saved_freq = ssid->frequency;

View File

@ -0,0 +1,64 @@
From 548e8ebd050dfc96c43315c0b5ed82225ea9ebf4 Mon Sep 17 00:00:00 2001
From: Peter Oh <peter.oh@bowerswilkins.com>
Date: Mon, 27 Aug 2018 14:28:46 -0700
Subject: [PATCH] mesh: do not set offchanok on DFS channels in non-ETSI
mac80211 does not allow mgmt tx to use off channel on
DFS channels in non-ETSI domain, because it will invalidate
CAC result on current operating channel.
(mac80211 commit: 34373d12f3cbb74960a73431138ef619d857996f)
Hence don't set offchanok for mgmt tx in case of DFS channels
in non-ETSI.
Signed-off-by: Peter Oh <peter.oh@bowerswilkins.com>
---
src/drivers/driver_nl80211.c | 21 ++++++++++++++++++++-
1 file changed, 20 insertions(+), 1 deletion(-)
diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
index 6764ba9df..858cf599a 100644
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
@@ -7462,6 +7462,10 @@ static int wpa_driver_nl80211_send_action(struct i802_bss *bss,
int ret = -1;
u8 *buf;
struct ieee80211_hdr *hdr;
+ struct hostapd_hw_modes *modes;
+ int i, offchanok = 1;
+ u16 num_modes, flags;
+ u8 dfs_domain;
wpa_printf(MSG_DEBUG, "nl80211: Send Action frame (ifindex=%d, "
"freq=%u MHz wait=%d ms no_cck=%d)",
@@ -7486,6 +7490,21 @@ static int wpa_driver_nl80211_send_action(struct i802_bss *bss,
os_memset(bss->rand_addr, 0, ETH_ALEN);
}
+ if (is_mesh_interface(drv->nlmode)) {
+ modes = nl80211_get_hw_feature_data(bss, &num_modes,
+ &flags, &dfs_domain);
+ if (dfs_domain != HOSTAPD_DFS_REGION_ETSI &&
+ ieee80211_is_dfs(bss->freq, modes, num_modes))
+ offchanok = 0;
+ if (modes) {
+ for (i = 0; i < num_modes; i++) {
+ os_free(modes[i].channels);
+ os_free(modes[i].rates);
+ }
+ os_free(modes);
+ }
+ }
+
if (is_ap_interface(drv->nlmode) &&
(!(drv->capa.flags & WPA_DRIVER_FLAGS_OFFCHANNEL_TX) ||
(int) freq == bss->freq || drv->device_ap_sme ||
@@ -7497,7 +7516,7 @@ static int wpa_driver_nl80211_send_action(struct i802_bss *bss,
ret = nl80211_send_frame_cmd(bss, freq, wait_time, buf,
24 + data_len,
&drv->send_action_cookie,
- no_cck, 0, 1, NULL, 0);
+ no_cck, 0, offchanok, NULL, 0);
os_free(buf);
return ret;

View File

@ -0,0 +1,62 @@
From f3a877c8961ba1e8955fa0323fdc209d630563db Mon Sep 17 00:00:00 2001
From: Peter Oh <peter.oh@bowerswilkins.com>
Date: Mon, 27 Aug 2018 14:28:47 -0700
Subject: [PATCH] mesh: fix channel switch error during CAC
Mesh interface has used its channel parameters that configured
during its initialization even after channel switched due to
DFS radar detection during CAC which caused channel switch error.
This change fixes the error by updating its channel parameters
when channel's been changed from initial one.
Signed-off-by: Peter Oh <peter.oh@bowerswilkins.com>
---
wpa_supplicant/mesh.c | 27 +++++++++++++++++++++++++++
1 file changed, 27 insertions(+)
diff --git a/wpa_supplicant/mesh.c b/wpa_supplicant/mesh.c
index f4b62a8fd..bfc7c7a39 100644
--- a/wpa_supplicant/mesh.c
+++ b/wpa_supplicant/mesh.c
@@ -13,6 +13,7 @@
#include "utils/uuid.h"
#include "common/ieee802_11_defs.h"
#include "common/wpa_ctrl.h"
+#include "common/hw_features_common.h"
#include "ap/sta_info.h"
#include "ap/hostapd.h"
#include "ap/ieee802_11.h"
@@ -204,6 +205,32 @@ static void wpas_mesh_complete_cb(void *ctx)
return;
}
+ /*
+ * inspect if channel's been changed since initialized.
+ * i.e. DFS radar detection
+ */
+ if (ifmsh->freq != params->freq.freq) {
+ wpa_s->assoc_freq = ifmsh->freq;
+ ssid->frequency = ifmsh->freq;
+ if (hostapd_set_freq_params(&params->freq,
+ ifmsh->conf->hw_mode,
+ ifmsh->freq,
+ ifmsh->conf->channel,
+ ifmsh->conf->ieee80211n,
+ ifmsh->conf->ieee80211ac,
+ ifmsh->conf->ieee80211ax,
+ ifmsh->conf->secondary_channel,
+ hostapd_get_oper_chwidth(ifmsh->conf),
+ hostapd_get_oper_centr_freq_seg0_idx(ifmsh->conf),
+ hostapd_get_oper_centr_freq_seg1_idx(ifmsh->conf),
+ ifmsh->current_mode->vht_capab,
+ &ifmsh->current_mode->he_capab[IEEE80211_MODE_AP])) {
+ wpa_printf(MSG_ERROR, "Error updating mesh frequency params.");
+ wpa_supplicant_mesh_deinit(wpa_s);
+ return;
+ }
+ }
+
if (ifmsh->mconf->security != MESH_CONF_SEC_NONE &&
wpas_mesh_init_rsn(wpa_s)) {
wpa_printf(MSG_ERROR,

View File

@ -0,0 +1,240 @@
From f3e8469b1fdbf953191a90100d8da18355caf7cb Mon Sep 17 00:00:00 2001
From: Daniel Golle <daniel@makrotopia.org>
Date: Wed, 18 Apr 2018 19:24:31 +0200
Subject: [PATCH] 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(-)
diff --git a/src/ap/ap_config.h b/src/ap/ap_config.h
index ea581a822..cfe59d4b4 100644
--- 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
@@ -666,6 +667,7 @@ struct hostapd_bss_config {
#define MESH_ENABLED BIT(0)
int mesh;
+ int mesh_fwding;
u8 radio_measurements[RRM_CAPABILITIES_IE_LEN];
diff --git a/src/drivers/driver.h b/src/drivers/driver.h
index 3c92fb76c..d73ff62c0 100644
--- a/src/drivers/driver.h
+++ b/src/drivers/driver.h
@@ -1450,6 +1450,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.
@@ -1459,6 +1460,7 @@ struct wpa_driver_mesh_bss_params {
int peer_link_timeout;
int max_peer_links;
int rssi_threshold;
+ int forwarding;
u16 ht_opmode;
};
diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
index 858cf599a..2930b01b4 100644
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
@@ -9592,6 +9592,9 @@ static int nl80211_put_mesh_config(struct nl_msg *msg,
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)) ||
diff --git a/wpa_supplicant/config.c b/wpa_supplicant/config.c
index 7a62f96d6..07ed344e4 100644
--- a/wpa_supplicant/config.c
+++ b/wpa_supplicant/config.c
@@ -2307,6 +2307,7 @@ static const struct parse_data ssid_fields[] = {
#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) },
@@ -2869,6 +2870,7 @@ void wpa_config_set_network_defaults(struct wpa_ssid *ssid)
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
@@ -4089,6 +4091,7 @@ struct wpa_config * wpa_config_alloc_empty(const char *ctrl_interface,
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;
@@ -4726,6 +4729,7 @@ static const struct global_parse_data global_fields[] = {
{ 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 },
diff --git a/wpa_supplicant/config.h b/wpa_supplicant/config.h
index 6a297ecfe..11e3fc62a 100644
--- 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.
@@ -1327,6 +1328,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
diff --git a/wpa_supplicant/config_file.c b/wpa_supplicant/config_file.c
index 77c326df5..7050a1ae6 100644
--- a/wpa_supplicant/config_file.c
+++ b/wpa_supplicant/config_file.c
@@ -829,6 +829,7 @@ static void wpa_config_write_network(FILE *f, struct wpa_ssid *ssid)
#endif /* IEEE8021X_EAPOL */
INT(mode);
INT(no_auto_peer);
+ INT(mesh_fwding);
INT(frequency);
INT(fixed_freq);
#ifdef CONFIG_ACS
@@ -1472,6 +1473,9 @@ static void wpa_config_write_global(FILE *f, struct wpa_config *config)
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",
diff --git a/wpa_supplicant/config_ssid.h b/wpa_supplicant/config_ssid.h
index d5c5c00a9..a052390ad 100644
--- a/wpa_supplicant/config_ssid.h
+++ b/wpa_supplicant/config_ssid.h
@@ -516,6 +516,11 @@ struct wpa_ssid {
int dot11MeshConfirmTimeout; /* msec */
int dot11MeshHoldingTimeout; /* msec */
+ /**
+ * Mesh network layer-2 forwarding
+ */
+ int mesh_fwding;
+
int ht;
int ht40;
diff --git a/wpa_supplicant/mesh.c b/wpa_supplicant/mesh.c
index bfc7c7a39..fa39e60bb 100644
--- a/wpa_supplicant/mesh.c
+++ b/wpa_supplicant/mesh.c
@@ -126,6 +126,7 @@ static struct mesh_conf * mesh_config_create(struct wpa_supplicant *wpa_s,
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;
@@ -328,6 +329,7 @@ static int wpa_supplicant_mesh_init(struct wpa_supplicant *wpa_s,
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]) {
@@ -549,6 +551,10 @@ int wpa_supplicant_join_mesh(struct wpa_supplicant *wpa_s,
}
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)) {
diff --git a/wpa_supplicant/mesh_mpm.c b/wpa_supplicant/mesh_mpm.c
index 4a163b6eb..0b65b84a8 100644
--- a/wpa_supplicant/mesh_mpm.c
+++ b/wpa_supplicant/mesh_mpm.c
@@ -305,9 +305,9 @@ static void mesh_mpm_send_plink_action(struct wpa_supplicant *wpa_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);
diff --git a/wpa_supplicant/wpa_supplicant.conf b/wpa_supplicant/wpa_supplicant.conf
index 1159bdcdc..6dc6ef89b 100644
--- a/wpa_supplicant/wpa_supplicant.conf
+++ b/wpa_supplicant/wpa_supplicant.conf
@@ -153,6 +153,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

View File

@ -1,26 +0,0 @@
--- a/src/ap/ieee802_11.c
+++ b/src/ap/ieee802_11.c
@@ -4944,6 +4944,13 @@ static int add_associated_sta(struct hos
* drivers to accept the STA parameter configuration. Since this is
* after a new FT-over-DS exchange, a new TK has been derived, so key
* reinstallation is not a concern for this case.
+ *
+ * If the STA was associated and authorized earlier, but came for a new
+ * connection (!added_unassoc + !reassoc), remove the existing STA entry
+ * so that it can be re-added. This case is rarely seen when the AP could
+ * not receive the deauth/disassoc frame from the STA. And the STA comes
+ * back with new connection within a short period or before the inactive
+ * STA entry is removed from the list.
*/
wpa_printf(MSG_DEBUG, "Add associated STA " MACSTR
" (added_unassoc=%d auth_alg=%u ft_over_ds=%u reassoc=%d authorized=%d ft_tk=%d fils_tk=%d)",
@@ -4957,7 +4964,8 @@ static int add_associated_sta(struct hos
(!(sta->flags & WLAN_STA_AUTHORIZED) ||
(reassoc && sta->ft_over_ds && sta->auth_alg == WLAN_AUTH_FT) ||
(!wpa_auth_sta_ft_tk_already_set(sta->wpa_sm) &&
- !wpa_auth_sta_fils_tk_already_set(sta->wpa_sm)))) {
+ !wpa_auth_sta_fils_tk_already_set(sta->wpa_sm)) ||
+ (!reassoc && (sta->flags & WLAN_STA_AUTHORIZED)))) {
hostapd_drv_sta_remove(hapd, sta->addr);
wpa_auth_sm_event(sta->wpa_sm, WPA_DRV_STA_REMOVED);
set = 0;

View File

@ -1,31 +0,0 @@
From a035c0a0419a9936e043e90a8c6f66f2ab5f08b5 Mon Sep 17 00:00:00 2001
From: Felix Fietkau <nbd@nbd.name>
Date: Thu, 8 Jul 2021 16:33:03 +0200
Subject: [PATCH] hostapd: fix use of uninitialized stack variables
When a CSA is performed on an 80 MHz channel, hostapd_change_config_freq
unconditionally calls hostapd_set_oper_centr_freq_seg0/1_idx with seg0/1
filled by ieee80211_freq_to_chan.
However, if ieee80211_freq_to_chan fails (because the freq is 0 or invalid),
seg0/1 remains uninitialized and filled with stack garbage, causing errors
such as "hostapd: 80 MHz: center segment 1 configured"
Signed-off-by: Felix Fietkau <nbd@nbd.name>
---
src/ap/hostapd.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c
index f6fe8a8a0..2b07a9283 100644
--- a/src/ap/hostapd.c
+++ b/src/ap/hostapd.c
@@ -3453,7 +3453,7 @@ static int hostapd_change_config_freq(struct hostapd_data *hapd,
struct hostapd_freq_params *old_params)
{
int channel;
- u8 seg0, seg1;
+ u8 seg0 = 0, seg1 = 0;
struct hostapd_hw_modes *mode;
if (!params->channel) {

View File

@ -1,25 +0,0 @@
From 97eb8d6e7a1b8fe424b9a0cae1985b6057324fe6 Mon Sep 17 00:00:00 2001
From: Felix Fietkau <nbd@nbd.name>
Date: Wed, 28 Jul 2021 05:43:29 +0200
Subject: [PATCH] ndisc_snoop: call dl_list_del before freeing ipv6 addresses
Fixes a segmentation fault on sta disconnect
Signed-off-by: Felix Fietkau <nbd@nbd.name>
---
src/ap/ndisc_snoop.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/ap/ndisc_snoop.c b/src/ap/ndisc_snoop.c
index 788c12fdc..bc1eb6251 100644
--- a/src/ap/ndisc_snoop.c
+++ b/src/ap/ndisc_snoop.c
@@ -61,6 +61,7 @@ void sta_ip6addr_del(struct hostapd_data *hapd, struct sta_info *sta)
dl_list_for_each_safe(ip6addr, prev, &sta->ip6addr, struct ip6addr,
list) {
hostapd_drv_br_delete_ip_neigh(hapd, 6, (u8 *) &ip6addr->addr);
+ dl_list_del(&ip6addr->list);
os_free(ip6addr);
}
}

View File

@ -1,281 +0,0 @@
From e5583c6d58d48ab01ee6fcd2086cb60448828cb8 Mon Sep 17 00:00:00 2001
From: Felix Fietkau <nbd@nbd.name>
Date: Wed, 28 Jul 2021 05:49:46 +0200
Subject: [PATCH] driver_nl80211: rewrite neigh code to not depend on
libnl3-route
Removes an unnecessary dependency and also makes the code smaller
Signed-off-by: Felix Fietkau <nbd@nbd.name>
---
src/drivers/driver_nl80211.c | 148 ++++++++++++++---------------------
1 file changed, 58 insertions(+), 90 deletions(-)
diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
index d62d685f4..de6a6c2f6 100644
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
@@ -16,9 +16,6 @@
#include <net/if.h>
#include <netlink/genl/genl.h>
#include <netlink/genl/ctrl.h>
-#ifdef CONFIG_LIBNL3_ROUTE
-#include <netlink/route/neighbour.h>
-#endif /* CONFIG_LIBNL3_ROUTE */
#include <linux/rtnetlink.h>
#include <netpacket/packet.h>
#include <linux/errqueue.h>
@@ -5333,26 +5330,29 @@ fail:
static void rtnl_neigh_delete_fdb_entry(struct i802_bss *bss, const u8 *addr)
{
-#ifdef CONFIG_LIBNL3_ROUTE
struct wpa_driver_nl80211_data *drv = bss->drv;
- struct rtnl_neigh *rn;
- struct nl_addr *nl_addr;
+ struct ndmsg nhdr = {
+ .ndm_state = NUD_PERMANENT,
+ .ndm_ifindex = bss->ifindex,
+ .ndm_family = AF_BRIDGE,
+ };
+ struct nl_msg *msg;
int err;
- rn = rtnl_neigh_alloc();
- if (!rn)
+ msg = nlmsg_alloc_simple(RTM_DELNEIGH, NLM_F_CREATE);
+ if (!msg)
return;
- rtnl_neigh_set_family(rn, AF_BRIDGE);
- rtnl_neigh_set_ifindex(rn, bss->ifindex);
- nl_addr = nl_addr_build(AF_BRIDGE, (void *) addr, ETH_ALEN);
- if (!nl_addr) {
- rtnl_neigh_put(rn);
- return;
- }
- rtnl_neigh_set_lladdr(rn, nl_addr);
+ if (nlmsg_append(msg, &nhdr, sizeof(nhdr), NLMSG_ALIGNTO) < 0)
+ goto errout;
+
+ if (nla_put(msg, NDA_LLADDR, ETH_ALEN, (void *)addr))
+ goto errout;
+
+ if (nl_send_auto_complete(drv->rtnl_sk, msg) < 0)
+ goto errout;
- err = rtnl_neigh_delete(drv->rtnl_sk, rn, 0);
+ err = nl_wait_for_ack(drv->rtnl_sk);
if (err < 0) {
wpa_printf(MSG_DEBUG, "nl80211: bridge FDB entry delete for "
MACSTR " ifindex=%d failed: %s", MAC2STR(addr),
@@ -5362,9 +5362,8 @@ static void rtnl_neigh_delete_fdb_entry(struct i802_bss *bss, const u8 *addr)
MACSTR, MAC2STR(addr));
}
- nl_addr_put(nl_addr);
- rtnl_neigh_put(rn);
-#endif /* CONFIG_LIBNL3_ROUTE */
+errout:
+ nlmsg_free(msg);
}
@@ -7747,7 +7746,6 @@ static void *i802_init(struct hostapd_data *hapd,
(params->num_bridge == 0 || !params->bridge[0]))
add_ifidx(drv, br_ifindex, drv->ifindex);
-#ifdef CONFIG_LIBNL3_ROUTE
if (bss->added_if_into_bridge || bss->already_in_bridge) {
int err;
@@ -7764,7 +7762,6 @@ static void *i802_init(struct hostapd_data *hapd,
goto failed;
}
}
-#endif /* CONFIG_LIBNL3_ROUTE */
if (drv->capa.flags2 & WPA_DRIVER_FLAGS2_CONTROL_PORT_RX) {
wpa_printf(MSG_DEBUG,
@@ -10797,13 +10794,14 @@ static int wpa_driver_br_add_ip_neigh(void *priv, u8 version,
const u8 *ipaddr, int prefixlen,
const u8 *addr)
{
-#ifdef CONFIG_LIBNL3_ROUTE
struct i802_bss *bss = priv;
struct wpa_driver_nl80211_data *drv = bss->drv;
- struct rtnl_neigh *rn;
- struct nl_addr *nl_ipaddr = NULL;
- struct nl_addr *nl_lladdr = NULL;
- int family, addrsize;
+ struct ndmsg nhdr = {
+ .ndm_state = NUD_PERMANENT,
+ .ndm_ifindex = bss->br_ifindex,
+ };
+ struct nl_msg *msg;
+ int addrsize;
int res;
if (!ipaddr || prefixlen == 0 || !addr)
@@ -10822,85 +10820,66 @@ static int wpa_driver_br_add_ip_neigh(void *priv, u8 version,
}
if (version == 4) {
- family = AF_INET;
+ nhdr.ndm_family = AF_INET;
addrsize = 4;
} else if (version == 6) {
- family = AF_INET6;
+ nhdr.ndm_family = AF_INET6;
addrsize = 16;
} else {
return -EINVAL;
}
- rn = rtnl_neigh_alloc();
- if (rn == NULL)
+ msg = nlmsg_alloc_simple(RTM_NEWNEIGH, NLM_F_CREATE);
+ if (!msg)
return -ENOMEM;
- /* set the destination ip address for neigh */
- nl_ipaddr = nl_addr_build(family, (void *) ipaddr, addrsize);
- if (nl_ipaddr == NULL) {
- wpa_printf(MSG_DEBUG, "nl80211: nl_ipaddr build failed");
- res = -ENOMEM;
+ res = -ENOMEM;
+ if (nlmsg_append(msg, &nhdr, sizeof(nhdr), NLMSG_ALIGNTO) < 0)
goto errout;
- }
- nl_addr_set_prefixlen(nl_ipaddr, prefixlen);
- res = rtnl_neigh_set_dst(rn, nl_ipaddr);
- if (res) {
- wpa_printf(MSG_DEBUG,
- "nl80211: neigh set destination addr failed");
+
+ if (nla_put(msg, NDA_DST, addrsize, (void *)ipaddr))
goto errout;
- }
- /* set the corresponding lladdr for neigh */
- nl_lladdr = nl_addr_build(AF_BRIDGE, (u8 *) addr, ETH_ALEN);
- if (nl_lladdr == NULL) {
- wpa_printf(MSG_DEBUG, "nl80211: neigh set lladdr failed");
- res = -ENOMEM;
+ if (nla_put(msg, NDA_LLADDR, ETH_ALEN, (void *)addr))
goto errout;
- }
- rtnl_neigh_set_lladdr(rn, nl_lladdr);
- rtnl_neigh_set_ifindex(rn, bss->br_ifindex);
- rtnl_neigh_set_state(rn, NUD_PERMANENT);
+ res = nl_send_auto_complete(drv->rtnl_sk, msg);
+ if (res < 0)
+ goto errout;
- res = rtnl_neigh_add(drv->rtnl_sk, rn, NLM_F_CREATE);
+ res = nl_wait_for_ack(drv->rtnl_sk);
if (res) {
wpa_printf(MSG_DEBUG,
"nl80211: Adding bridge ip neigh failed: %s",
nl_geterror(res));
}
errout:
- if (nl_lladdr)
- nl_addr_put(nl_lladdr);
- if (nl_ipaddr)
- nl_addr_put(nl_ipaddr);
- if (rn)
- rtnl_neigh_put(rn);
+ nlmsg_free(msg);
return res;
-#else /* CONFIG_LIBNL3_ROUTE */
- return -1;
-#endif /* CONFIG_LIBNL3_ROUTE */
}
static int wpa_driver_br_delete_ip_neigh(void *priv, u8 version,
const u8 *ipaddr)
{
-#ifdef CONFIG_LIBNL3_ROUTE
struct i802_bss *bss = priv;
struct wpa_driver_nl80211_data *drv = bss->drv;
- struct rtnl_neigh *rn;
- struct nl_addr *nl_ipaddr;
- int family, addrsize;
+ struct ndmsg nhdr = {
+ .ndm_state = NUD_PERMANENT,
+ .ndm_ifindex = bss->br_ifindex,
+ };
+ struct nl_msg *msg;
+ int addrsize;
int res;
if (!ipaddr)
return -EINVAL;
if (version == 4) {
- family = AF_INET;
+ nhdr.ndm_family = AF_INET;
addrsize = 4;
} else if (version == 6) {
- family = AF_INET6;
+ nhdr.ndm_family = AF_INET6;
addrsize = 16;
} else {
return -EINVAL;
@@ -10918,41 +10897,30 @@ static int wpa_driver_br_delete_ip_neigh(void *priv, u8 version,
return -1;
}
- rn = rtnl_neigh_alloc();
- if (rn == NULL)
+ msg = nlmsg_alloc_simple(RTM_DELNEIGH, NLM_F_CREATE);
+ if (!msg)
return -ENOMEM;
- /* set the destination ip address for neigh */
- nl_ipaddr = nl_addr_build(family, (void *) ipaddr, addrsize);
- if (nl_ipaddr == NULL) {
- wpa_printf(MSG_DEBUG, "nl80211: nl_ipaddr build failed");
- res = -ENOMEM;
+ res = -ENOMEM;
+ if (nlmsg_append(msg, &nhdr, sizeof(nhdr), NLMSG_ALIGNTO) < 0)
goto errout;
- }
- res = rtnl_neigh_set_dst(rn, nl_ipaddr);
- if (res) {
- wpa_printf(MSG_DEBUG,
- "nl80211: neigh set destination addr failed");
+
+ if (nla_put(msg, NDA_DST, addrsize, (void *)ipaddr))
goto errout;
- }
- rtnl_neigh_set_ifindex(rn, bss->br_ifindex);
+ res = nl_send_auto_complete(drv->rtnl_sk, msg);
+ if (res < 0)
+ goto errout;
- res = rtnl_neigh_delete(drv->rtnl_sk, rn, 0);
+ res = nl_wait_for_ack(drv->rtnl_sk);
if (res) {
wpa_printf(MSG_DEBUG,
"nl80211: Deleting bridge ip neigh failed: %s",
nl_geterror(res));
}
errout:
- if (nl_ipaddr)
- nl_addr_put(nl_ipaddr);
- if (rn)
- rtnl_neigh_put(rn);
+ nlmsg_free(msg);
return res;
-#else /* CONFIG_LIBNL3_ROUTE */
- return -1;
-#endif /* CONFIG_LIBNL3_ROUTE */
}

View File

@ -1,40 +0,0 @@
From 9450fcbac73a7f0eb1bcac4d7dd25d5d9309bb87 Mon Sep 17 00:00:00 2001
From: Felix Fietkau <nbd@nbd.name>
Date: Mon, 18 Feb 2019 12:57:11 +0100
Subject: [PATCH] mesh: allow processing authentication frames in blocked state
If authentication fails repeatedly e.g. because of a weak signal, the link
can end up in blocked state. If one of the nodes tries to establish a link
again before it is unblocked on the other side, it will block the link to
that other side. The same happens on the other side when it unblocks the
link. In that scenario, the link never recovers on its own.
To fix this, allow restarting authentication even if the link is in blocked
state, but don't initiate the attempt until the blocked period is over.
Signed-off-by: Felix Fietkau <nbd@nbd.name>
---
src/ap/ieee802_11.c | 9 ---------
1 file changed, 9 deletions(-)
diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c
index e0d75498c..8f7e3de21 100644
--- a/src/ap/ieee802_11.c
+++ b/src/ap/ieee802_11.c
@@ -3775,15 +3775,6 @@ static void handle_auth(struct hostapd_data *hapd,
seq_ctrl);
return;
}
-#ifdef CONFIG_MESH
- if ((hapd->conf->mesh & MESH_ENABLED) &&
- sta->plink_state == PLINK_BLOCKED) {
- wpa_printf(MSG_DEBUG, "Mesh peer " MACSTR
- " is blocked - drop Authentication frame",
- MAC2STR(mgmt->sa));
- return;
- }
-#endif /* CONFIG_MESH */
#ifdef CONFIG_PASN
if (auth_alg == WLAN_AUTH_PASN &&
(sta->flags & WLAN_STA_ASSOC)) {

View File

@ -1,33 +0,0 @@
From 15ddf28504bf656e6c8de16db69fd0cb9cbf7ae0 Mon Sep 17 00:00:00 2001
From: OpenEmbedded <oe.patch@oe>
Date: Thu, 15 Sep 2022 12:35:24 +0000
---
hostapd/Makefile | 1 +
wpa_supplicant/Makefile | 1 +
2 files changed, 2 insertions(+)
diff --git a/hostapd/Makefile b/hostapd/Makefile
index 73cf28c1a..4e79daa73 100644
--- a/hostapd/Makefile
+++ b/hostapd/Makefile
@@ -324,6 +324,7 @@ ifdef CONFIG_FILS
CFLAGS += -DCONFIG_FILS
OBJS += ../src/ap/fils_hlp.o
NEED_SHA384=y
+NEED_HMAC_SHA384_KDF=y
NEED_AES_SIV=y
ifdef CONFIG_FILS_SK_PFS
CFLAGS += -DCONFIG_FILS_SK_PFS
diff --git a/wpa_supplicant/Makefile b/wpa_supplicant/Makefile
index a6bcb4c42..707d6dc88 100644
--- a/wpa_supplicant/Makefile
+++ b/wpa_supplicant/Makefile
@@ -320,6 +320,7 @@ endif
ifdef CONFIG_FILS
CFLAGS += -DCONFIG_FILS
NEED_SHA384=y
+NEED_HMAC_SHA384_KDF=y
NEED_AES_SIV=y
ifdef CONFIG_FILS_SK_PFS
CFLAGS += -DCONFIG_FILS_SK_PFS

View File

@ -0,0 +1,40 @@
From 72c752918b70221382c73a7b152b1515ac500543 Mon Sep 17 00:00:00 2001
From: Felix Fietkau <nbd@nbd.name>
Date: Tue, 12 Feb 2019 14:22:43 +0100
Subject: [PATCH] wpa_supplicant: fix race condition in mesh mpm new peer
handling
When wpa_supplicant receives another new peer event before the first one
has been processed, it tries to add a station to the driver a second time
(which fails) and then tears down the station entry until another event
comes in.
Fix this by only adding a station to the driver if it didn't exist already.
Signed-off-by: Felix Fietkau <nbd@nbd.name>
---
wpa_supplicant/mesh_mpm.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/wpa_supplicant/mesh_mpm.c b/wpa_supplicant/mesh_mpm.c
index 0b65b84a8..46144df09 100644
--- a/wpa_supplicant/mesh_mpm.c
+++ b/wpa_supplicant/mesh_mpm.c
@@ -710,11 +710,12 @@ static struct sta_info * mesh_mpm_add_peer(struct wpa_supplicant *wpa_s,
}
sta = ap_get_sta(data, addr);
- if (!sta) {
- sta = ap_sta_add(data, addr);
- if (!sta)
- return NULL;
- }
+ if (sta)
+ return NULL;
+
+ sta = ap_sta_add(data, addr);
+ if (!sta)
+ return NULL;
/* Set WMM by default since Mesh STAs are QoS STAs */
sta->flags |= WLAN_STA_WMM;

View File

@ -0,0 +1,71 @@
From 992ca79a51cc0f300a100795a124b8263fea7852 Mon Sep 17 00:00:00 2001
From: Jouni Malinen <j@w1.fi>
Date: Thu, 29 Aug 2019 11:52:04 +0300
Subject: [PATCH] AP: Silently ignore management frame from unexpected source
address
Do not process any received Management frames with unexpected/invalid SA
so that we do not add any state for unexpected STA addresses or end up
sending out frames to unexpected destination. This prevents unexpected
sequences where an unprotected frame might end up causing the AP to send
out a response to another device and that other device processing the
unexpected response.
In particular, this prevents some potential denial of service cases
where the unexpected response frame from the AP might result in a
connected station dropping its association.
Signed-off-by: Jouni Malinen <j@w1.fi>
---
src/ap/drv_callbacks.c | 13 +++++++++++++
src/ap/ieee802_11.c | 12 ++++++++++++
2 files changed, 25 insertions(+)
diff --git a/src/ap/drv_callbacks.c b/src/ap/drv_callbacks.c
index 31587685f..34ca379ed 100644
--- a/src/ap/drv_callbacks.c
+++ b/src/ap/drv_callbacks.c
@@ -131,6 +131,19 @@ int hostapd_notif_assoc(struct hostapd_data *hapd, const u8 *addr,
"hostapd_notif_assoc: Skip event with no address");
return -1;
}
+
+ if (is_multicast_ether_addr(addr) ||
+ is_zero_ether_addr(addr) ||
+ os_memcmp(addr, hapd->own_addr, ETH_ALEN) == 0) {
+ /* Do not process any frames with unexpected/invalid SA so that
+ * we do not add any state for unexpected STA addresses or end
+ * up sending out frames to unexpected destination. */
+ wpa_printf(MSG_DEBUG, "%s: Invalid SA=" MACSTR
+ " in received indication - ignore this indication silently",
+ __func__, MAC2STR(addr));
+ return 0;
+ }
+
random_add_randomness(addr, ETH_ALEN);
hostapd_logger(hapd, addr, HOSTAPD_MODULE_IEEE80211,
diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c
index c85a28db4..e7065372e 100644
--- a/src/ap/ieee802_11.c
+++ b/src/ap/ieee802_11.c
@@ -4626,6 +4626,18 @@ int ieee802_11_mgmt(struct hostapd_data *hapd, const u8 *buf, size_t len,
fc = le_to_host16(mgmt->frame_control);
stype = WLAN_FC_GET_STYPE(fc);
+ if (is_multicast_ether_addr(mgmt->sa) ||
+ is_zero_ether_addr(mgmt->sa) ||
+ os_memcmp(mgmt->sa, hapd->own_addr, ETH_ALEN) == 0) {
+ /* Do not process any frames with unexpected/invalid SA so that
+ * we do not add any state for unexpected STA addresses or end
+ * up sending out frames to unexpected destination. */
+ wpa_printf(MSG_DEBUG, "MGMT: Invalid SA=" MACSTR
+ " in received frame - ignore this frame silently",
+ MAC2STR(mgmt->sa));
+ return 0;
+ }
+
if (stype == WLAN_FC_STYPE_BEACON) {
handle_beacon(hapd, mgmt, len, fi);
return 1;

View File

@ -0,0 +1,46 @@
From 2e1c4caa71155fdf53ed8acb18d5b3e3cfd69660 Mon Sep 17 00:00:00 2001
From: Felix Fietkau <nbd@nbd.name>
Date: Thu, 23 Jan 2020 13:50:47 +0100
Subject: [PATCH] driver_nl80211: fix WMM queue mapping for regulatory limit
nl80211 uses a different queue mapping from hostap, so AC indexes need to
be converted.
Signed-off-by: Felix Fietkau <nbd@nbd.name>
---
src/drivers/driver_nl80211_capa.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/src/drivers/driver_nl80211_capa.c b/src/drivers/driver_nl80211_capa.c
index 8318b10ab..0d35b13b5 100644
--- a/src/drivers/driver_nl80211_capa.c
+++ b/src/drivers/driver_nl80211_capa.c
@@ -1403,6 +1403,12 @@ static void phy_info_freq(struct hostapd_hw_modes *mode,
[NL80211_WMMR_AIFSN] = { .type = NLA_U8 },
[NL80211_WMMR_TXOP] = { .type = NLA_U16 },
};
+ static const u8 wmm_map[4] = {
+ [NL80211_AC_BE] = WMM_AC_BE,
+ [NL80211_AC_BK] = WMM_AC_BK,
+ [NL80211_AC_VI] = WMM_AC_VI,
+ [NL80211_AC_VO] = WMM_AC_VO,
+ };
struct nlattr *nl_wmm;
struct nlattr *tb_wmm[NL80211_WMMR_MAX + 1];
int rem_wmm, ac, count = 0;
@@ -1424,12 +1430,13 @@ static void phy_info_freq(struct hostapd_hw_modes *mode,
return;
}
ac = nl_wmm->nla_type;
- if (ac < 0 || ac >= WMM_AC_NUM) {
+ if (ac >= ARRAY_SIZE(wmm_map)) {
wpa_printf(MSG_DEBUG,
"nl80211: Invalid AC value %d", ac);
return;
}
+ ac = wmm_map[ac];
chan->wmm_rules[ac].min_cwmin =
nla_get_u16(tb_wmm[NL80211_WMMR_CW_MIN]);
chan->wmm_rules[ac].min_cwmax =

View File

@ -0,0 +1,53 @@
From 55835a231c505b049b83977e8023eb8d7ea9d4e1 Mon Sep 17 00:00:00 2001
From: Felix Fietkau <nbd@nbd.name>
Date: Thu, 23 Jan 2020 14:10:20 +0100
Subject: [PATCH] driver_nl80211: fix regulatory limits for wmm cwmin/cwmax
values
The internal WMM AC parameters use just the exponent of the CW value, while
nl80211 reports the full CW value.
This led to completely bogus CWmin/CWmax values in the WMM IE when a regulatory
limit was present. Fix this by converting the value to the exponent before
passing it on
Signed-off-by: Felix Fietkau <nbd@nbd.name>
---
src/drivers/driver_nl80211_capa.c | 16 ++++++++++++++--
1 file changed, 14 insertions(+), 2 deletions(-)
diff --git a/src/drivers/driver_nl80211_capa.c b/src/drivers/driver_nl80211_capa.c
index 0d35b13b5..0defd6c7b 100644
--- a/src/drivers/driver_nl80211_capa.c
+++ b/src/drivers/driver_nl80211_capa.c
@@ -1336,6 +1336,18 @@ static void phy_info_vht_capa(struct hostapd_hw_modes *mode,
}
}
+static inline int cw2ecw(unsigned int cw)
+{
+ int bit;
+
+ if (cw == 0)
+ return 0;
+
+ for (bit = 1; cw != 1; bit++)
+ cw >>= 1;
+
+ return bit;
+}
static void phy_info_freq(struct hostapd_hw_modes *mode,
struct hostapd_channel_data *chan,
@@ -1438,9 +1450,9 @@ static void phy_info_freq(struct hostapd_hw_modes *mode,
ac = wmm_map[ac];
chan->wmm_rules[ac].min_cwmin =
- nla_get_u16(tb_wmm[NL80211_WMMR_CW_MIN]);
+ cw2ecw(nla_get_u16(tb_wmm[NL80211_WMMR_CW_MIN]));
chan->wmm_rules[ac].min_cwmax =
- nla_get_u16(tb_wmm[NL80211_WMMR_CW_MAX]);
+ cw2ecw(nla_get_u16(tb_wmm[NL80211_WMMR_CW_MAX]));
chan->wmm_rules[ac].min_aifs =
nla_get_u8(tb_wmm[NL80211_WMMR_AIFSN]);
chan->wmm_rules[ac].max_txop =

View File

@ -0,0 +1,29 @@
From de5ea86978634ecc7d936a170dd1d368fd4ed31b Mon Sep 17 00:00:00 2001
From: Jouni Malinen <jouni@codeaurora.org>
Date: Mon, 14 Oct 2019 19:27:47 +0300
Subject: [PATCH] wolfSSL: Fix crypto_bignum_sub()
The initial crypto wrapper implementation for wolfSSL seems to have
included a copy-paste error in crypto_bignum_sub() implementation that
was identical to crypto_bignum_add() while mp_sub() should have been
used instead of mp_add().
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
---
src/crypto/crypto_wolfssl.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/crypto/crypto_wolfssl.c b/src/crypto/crypto_wolfssl.c
index 4cedab436..960caf32a 100644
--- a/src/crypto/crypto_wolfssl.c
+++ b/src/crypto/crypto_wolfssl.c
@@ -1151,7 +1151,7 @@ int crypto_bignum_sub(const struct crypto_bignum *a,
if (TEST_FAIL())
return -1;
- return mp_add((mp_int *) a, (mp_int *) b,
+ return mp_sub((mp_int *) a, (mp_int *) b,
(mp_int *) r) == MP_OKAY ? 0 : -1;
}

View File

@ -1,13 +1,13 @@
From ec89cf6113ab9324e0095b8ea64eb93a3ff98b11 Mon Sep 17 00:00:00 2001
From 344ed019cfedec05e6fdb4b6059354b090155f6f Mon Sep 17 00:00:00 2001
From: Patrick Walther <patrick.walther@netmodule.com>
Date: Fri, 24 Jul 2020 14:41:09 +0200
Date: Tue, 28 Jan 2020 15:14:35 +0100
---
src/utils/os_unix.c | 68 +++++++++++++++++++--------------------------
src/utils/os_unix.c | 68 ++++++++++++++++++++++-------------------------------
1 file changed, 28 insertions(+), 40 deletions(-)
diff --git a/src/utils/os_unix.c b/src/utils/os_unix.c
index 258deef9d..5b026f8f6 100644
index 800c50772..6231974cf 100644
--- a/src/utils/os_unix.c
+++ b/src/utils/os_unix.c
@@ -10,6 +10,7 @@
@ -18,7 +18,7 @@ index 258deef9d..5b026f8f6 100644
#ifdef ANDROID
#include <sys/capability.h>
@@ -188,59 +189,46 @@ int os_gmtime(os_time_t t, struct os_tm *tm)
@@ -182,59 +183,46 @@ int os_gmtime(os_time_t t, struct os_tm *tm)
return 0;
}

View File

@ -1,6 +1,6 @@
From c3efbfb27f3797b84e861a01f3e4f0dadc21966d Mon Sep 17 00:00:00 2001
From 424e215228221cd61f574b4b40cb77e0666d9d37 Mon Sep 17 00:00:00 2001
From: Patrick Walther <patrick.walther@netmodule.com>
Date: Fri, 24 Jul 2020 14:41:09 +0200
Date: Tue, 28 Jan 2020 15:14:35 +0100
---
hostapd/Makefile | 26 ++++++++++++++++++++++----
@ -16,18 +16,18 @@ Date: Fri, 24 Jul 2020 14:41:09 +0200
10 files changed, 94 insertions(+), 17 deletions(-)
diff --git a/hostapd/Makefile b/hostapd/Makefile
index 4e79daa73..6c34c5f88 100644
index 2a6bd7ac8..da8f9bc9b 100644
--- a/hostapd/Makefile
+++ b/hostapd/Makefile
@@ -1,6 +1,7 @@
ALL=hostapd hostapd_cli
CONFIG_FILE = .config
@@ -28,6 +28,7 @@ CFLAGS += -I$(abspath ../src/utils)
export BINDIR ?= /usr/local/bin/
-include .config
+-include $(if $(MULTICALL), ../wpa_supplicant/.config)
include ../src/build.rules
ifdef LIBS
@@ -199,7 +200,8 @@ endif
ifndef CONFIG_NO_GITVER
# Add VERSION_STR postfix for builds from a git repository
@@ -198,7 +199,8 @@ endif
ifdef CONFIG_NO_VLAN
CFLAGS += -DCONFIG_NO_VLAN
@ -37,7 +37,7 @@ index 4e79daa73..6c34c5f88 100644
OBJS += ../src/ap/vlan_init.o
OBJS += ../src/ap/vlan_ifconfig.o
OBJS += ../src/ap/vlan.o
@@ -357,10 +359,14 @@ CFLAGS += -DCONFIG_MBO
@@ -366,10 +368,14 @@ CFLAGS += -DCONFIG_MBO
OBJS += ../src/ap/mbo_ap.o
endif
@ -55,9 +55,9 @@ index 4e79daa73..6c34c5f88 100644
LIBS += $(DRV_AP_LIBS)
ifdef CONFIG_L2_PACKET
@@ -1291,6 +1297,12 @@ install: $(addprefix $(DESTDIR)$(BINDIR)/,$(ALL))
_OBJS_VAR := OBJS
include ../src/objs.mk
@@ -1316,6 +1322,12 @@ install: $(addprefix $(DESTDIR)$(BINDIR)/,$(ALL))
BCHECK=../src/drivers/build.hostapd
+hostapd_multi.a: $(BCHECK) $(OBJS)
+ $(Q)$(CC) -c -o hostapd_multi.o -Dmain=hostapd_main $(CFLAGS) main.c
@ -65,12 +65,12 @@ index 4e79daa73..6c34c5f88 100644
+ @rm -f $@
+ @$(AR) cr $@ hostapd_multi.o $(OBJS)
+
hostapd: $(OBJS)
hostapd: $(BCHECK) $(OBJS)
$(Q)$(CC) $(LDFLAGS) -o hostapd $(OBJS) $(LIBS)
@$(E) " LD " $@
@@ -1365,6 +1377,12 @@ include ../src/objs.mk
_OBJS_VAR := SOBJS
include ../src/objs.mk
@@ -1358,6 +1370,12 @@ ifeq ($(CONFIG_TLS), linux)
HOBJS += ../src/crypto/crypto_linux.o
endif
+dump_cflags:
+ @printf "%s " "$(CFLAGS)"
@ -82,10 +82,10 @@ index 4e79daa73..6c34c5f88 100644
$(Q)$(CC) $(LDFLAGS) -o nt_password_hash $(NOBJS) $(LIBS_n)
@$(E) " LD " $@
diff --git a/hostapd/main.c b/hostapd/main.c
index 21932d1be..6a7b91bf2 100644
index 08896ffe2..90424d5bd 100644
--- a/hostapd/main.c
+++ b/hostapd/main.c
@@ -591,6 +591,11 @@ fail:
@@ -592,6 +592,11 @@ fail:
return -1;
}
@ -97,20 +97,20 @@ index 21932d1be..6a7b91bf2 100644
#ifdef CONFIG_WPS
static int gen_uuid(const char *txt_addr)
@@ -684,6 +689,8 @@ int main(int argc, char *argv[])
@@ -682,6 +687,8 @@ int main(int argc, char *argv[])
return -1;
#endif /* CONFIG_DPP */
+ wpa_supplicant_event = hostapd_wpa_event;
+ wpa_supplicant_event_global = hostapd_wpa_event_global;
for (;;) {
c = getopt(argc, argv, "b:Bde:f:hi:KP:sSTtu:vg:G:q");
c = getopt(argc, argv, "b:Bde:f:hi:KP:sSTtu:vg:G:");
if (c < 0)
diff --git a/src/ap/drv_callbacks.c b/src/ap/drv_callbacks.c
index fff8bb3e5..4d70939ef 100644
index 34ca379ed..366cfc08a 100644
--- a/src/ap/drv_callbacks.c
+++ b/src/ap/drv_callbacks.c
@@ -1855,8 +1855,8 @@ err:
@@ -1669,8 +1669,8 @@ err:
#endif /* CONFIG_OWE */
@ -121,7 +121,7 @@ index fff8bb3e5..4d70939ef 100644
{
struct hostapd_data *hapd = ctx;
#ifndef CONFIG_NO_STDOUT_DEBUG
@@ -2128,7 +2128,7 @@ void wpa_supplicant_event(void *ctx, enum wpa_event_type event,
@@ -1915,7 +1915,7 @@ void wpa_supplicant_event(void *ctx, enum wpa_event_type event,
}
@ -131,10 +131,10 @@ index fff8bb3e5..4d70939ef 100644
{
struct hapd_interfaces *interfaces = ctx;
diff --git a/src/drivers/driver.h b/src/drivers/driver.h
index f069b74e1..f8f91c023 100644
index d73ff62c0..f35e3fdad 100644
--- a/src/drivers/driver.h
+++ b/src/drivers/driver.h
@@ -6168,8 +6168,8 @@ union wpa_event_data {
@@ -5657,8 +5657,8 @@ union wpa_event_data {
* Driver wrapper code should call this function whenever an event is received
* from the driver.
*/
@ -145,7 +145,7 @@ index f069b74e1..f8f91c023 100644
/**
* wpa_supplicant_event_global - Report a driver event for wpa_supplicant
@@ -6181,7 +6181,7 @@ void wpa_supplicant_event(void *ctx, enum wpa_event_type event,
@@ -5670,7 +5670,7 @@ void wpa_supplicant_event(void *ctx, enum wpa_event_type event,
* Same as wpa_supplicant_event(), but we search for the interface in
* wpa_global.
*/
@ -170,18 +170,18 @@ index e95df6ddb..9071da3cf 100644
const struct wpa_driver_ops *const wpa_drivers[] =
{
diff --git a/wpa_supplicant/Makefile b/wpa_supplicant/Makefile
index 707d6dc88..f7740e6f0 100644
index f1384d5fa..3d05870bd 100644
--- a/wpa_supplicant/Makefile
+++ b/wpa_supplicant/Makefile
@@ -10,6 +10,7 @@ ALL += dbus/fi.w1.wpa_supplicant1.service
EXTRA_TARGETS=dynamic_eap_methods
@@ -27,6 +27,7 @@ CFLAGS += -I$(abspath ../src)
CFLAGS += -I$(abspath ../src/utils)
CONFIG_FILE=.config
-include .config
+-include $(if $(MULTICALL),../hostapd/.config)
include ../src/build.rules
ifdef CONFIG_BUILD_WPA_CLIENT_SO
@@ -371,7 +372,9 @@ endif
ifndef CONFIG_NO_GITVER
# Add VERSION_STR postfix for builds from a git repository
@@ -363,7 +364,9 @@ endif
ifdef CONFIG_IBSS_RSN
NEED_RSN_AUTHENTICATOR=y
CFLAGS += -DCONFIG_IBSS_RSN
@ -191,7 +191,7 @@ index 707d6dc88..f7740e6f0 100644
OBJS += ibss_rsn.o
endif
@@ -912,6 +915,10 @@ ifdef CONFIG_DYNAMIC_EAP_METHODS
@@ -892,6 +895,10 @@ ifdef CONFIG_DYNAMIC_EAP_METHODS
CFLAGS += -DCONFIG_DYNAMIC_EAP_METHODS
LIBS += -ldl -rdynamic
endif
@ -202,7 +202,7 @@ index 707d6dc88..f7740e6f0 100644
endif
ifdef CONFIG_AP
@@ -919,9 +926,11 @@ NEED_EAP_COMMON=y
@@ -899,9 +906,11 @@ NEED_EAP_COMMON=y
NEED_RSN_AUTHENTICATOR=y
CFLAGS += -DCONFIG_AP
OBJS += ap.o
@ -214,7 +214,7 @@ index 707d6dc88..f7740e6f0 100644
OBJS += ../src/ap/hostapd.o
OBJS += ../src/ap/wpa_auth_glue.o
OBJS += ../src/ap/utils.o
@@ -1008,6 +1017,12 @@ endif
@@ -983,6 +992,12 @@ endif
ifdef CONFIG_HS20
OBJS += ../src/ap/hs20.o
endif
@ -227,7 +227,7 @@ index 707d6dc88..f7740e6f0 100644
endif
ifdef CONFIG_MBO
@@ -1016,7 +1031,9 @@ CFLAGS += -DCONFIG_MBO
@@ -991,7 +1006,9 @@ CFLAGS += -DCONFIG_MBO
endif
ifdef NEED_RSN_AUTHENTICATOR
@ -237,10 +237,10 @@ index 707d6dc88..f7740e6f0 100644
NEED_AES_WRAP=y
OBJS += ../src/ap/wpa_auth.o
OBJS += ../src/ap/wpa_auth_ie.o
@@ -1920,6 +1937,12 @@ wpa_priv: $(BCHECK) $(OBJS_priv)
@@ -1899,6 +1916,12 @@ wpa_priv: $(BCHECK) $(OBJS_priv)
$(OBJS_c) $(OBJS_t) $(OBJS_t2) $(OBJS) $(BCHECK) $(EXTRA_progs): .config
_OBJS_VAR := OBJS
include ../src/objs.mk
+wpa_supplicant_multi.a: .config $(BCHECK) $(OBJS) $(EXTRA_progs)
+ $(Q)$(CC) -c -o wpa_supplicant_multi.o -Dmain=wpa_supplicant_main $(CFLAGS) main.c
+ @$(E) " CC " $<
@ -250,7 +250,7 @@ index 707d6dc88..f7740e6f0 100644
wpa_supplicant: $(BCHECK) $(OBJS) $(EXTRA_progs)
$(Q)$(LDO) $(LDFLAGS) -o wpa_supplicant $(OBJS) $(LIBS) $(EXTRALIBS)
@$(E) " LD " $@
@@ -2052,6 +2075,12 @@ eap_gpsk.so: $(SRC_EAP_GPSK)
@@ -1999,6 +2022,12 @@ endif
$(Q)sed -e 's|\@BINDIR\@|$(BINDIR)|g' $< >$@
@$(E) " sed" $<
@ -264,10 +264,10 @@ index 707d6dc88..f7740e6f0 100644
mv -f $< $@
wpa_cli.exe: wpa_cli
diff --git a/wpa_supplicant/eapol_test.c b/wpa_supplicant/eapol_test.c
index efec31c65..ca6faacf2 100644
index 524724f19..fe18dfd73 100644
--- a/wpa_supplicant/eapol_test.c
+++ b/wpa_supplicant/eapol_test.c
@@ -31,7 +31,12 @@
@@ -30,7 +30,12 @@
#include "ctrl_iface.h"
#include "pcsc_funcs.h"
#include "wpas_glue.h"
@ -280,7 +280,7 @@ index efec31c65..ca6faacf2 100644
const struct wpa_driver_ops *const wpa_drivers[] = { NULL };
@@ -1303,6 +1308,10 @@ static void usage(void)
@@ -1292,6 +1297,10 @@ static void usage(void)
"option several times.\n");
}
@ -291,7 +291,7 @@ index efec31c65..ca6faacf2 100644
int main(int argc, char *argv[])
{
@@ -1323,6 +1332,8 @@ int main(int argc, char *argv[])
@@ -1312,6 +1321,8 @@ int main(int argc, char *argv[])
if (os_program_init())
return -1;
@ -301,10 +301,10 @@ index efec31c65..ca6faacf2 100644
os_memset(&eapol_test, 0, sizeof(eapol_test));
diff --git a/wpa_supplicant/events.c b/wpa_supplicant/events.c
index ec56cfdc0..48aa792b3 100644
index 87dad0811..067f76b48 100644
--- a/wpa_supplicant/events.c
+++ b/wpa_supplicant/events.c
@@ -4953,8 +4953,8 @@ static void wpas_event_unprot_beacon(struct wpa_supplicant *wpa_s,
@@ -4184,8 +4184,8 @@ static void wpas_event_assoc_reject(struct wpa_supplicant *wpa_s,
}
@ -315,7 +315,7 @@ index ec56cfdc0..48aa792b3 100644
{
struct wpa_supplicant *wpa_s = ctx;
int resched;
@@ -5813,7 +5813,7 @@ void wpa_supplicant_event(void *ctx, enum wpa_event_type event,
@@ -4967,7 +4967,7 @@ void wpa_supplicant_event(void *ctx, enum wpa_event_type event,
}
@ -325,10 +325,10 @@ index ec56cfdc0..48aa792b3 100644
{
struct wpa_supplicant *wpa_s;
diff --git a/wpa_supplicant/wpa_priv.c b/wpa_supplicant/wpa_priv.c
index ff1fb6702..731325929 100644
index b3ad45eca..55630a5c7 100644
--- a/wpa_supplicant/wpa_priv.c
+++ b/wpa_supplicant/wpa_priv.c
@@ -1038,8 +1038,8 @@ static void wpa_priv_send_ft_response(struct wpa_priv_interface *iface,
@@ -1031,8 +1031,8 @@ static void wpa_priv_send_ft_response(struct wpa_priv_interface *iface,
}
@ -339,7 +339,7 @@ index ff1fb6702..731325929 100644
{
struct wpa_priv_interface *iface = ctx;
@@ -1102,7 +1102,7 @@ void wpa_supplicant_event(void *ctx, enum wpa_event_type event,
@@ -1095,7 +1095,7 @@ void wpa_supplicant_event(void *ctx, enum wpa_event_type event,
}
@ -348,7 +348,7 @@ index ff1fb6702..731325929 100644
union wpa_event_data *data)
{
struct wpa_priv_global *global = ctx;
@@ -1216,6 +1216,8 @@ int main(int argc, char *argv[])
@@ -1207,6 +1207,8 @@ int main(int argc, char *argv[])
if (os_program_init())
return -1;
@ -358,10 +358,10 @@ index ff1fb6702..731325929 100644
os_memset(&global, 0, sizeof(global));
diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c
index fb47942c9..b00a24792 100644
index 578f274a9..4f95917c6 100644
--- a/wpa_supplicant/wpa_supplicant.c
+++ b/wpa_supplicant/wpa_supplicant.c
@@ -7073,7 +7073,6 @@ struct wpa_interface * wpa_supplicant_match_iface(struct wpa_global *global,
@@ -6096,7 +6096,6 @@ struct wpa_interface * wpa_supplicant_match_iface(struct wpa_global *global,
return NULL;
}
@ -369,7 +369,7 @@ index fb47942c9..b00a24792 100644
/**
* wpa_supplicant_match_existing - Match existing interfaces
* @global: Pointer to global data from wpa_supplicant_init()
@@ -7108,6 +7107,11 @@ static int wpa_supplicant_match_existing(struct wpa_global *global)
@@ -6133,6 +6132,11 @@ static int wpa_supplicant_match_existing(struct wpa_global *global)
#endif /* CONFIG_MATCH_IFACE */
@ -381,7 +381,7 @@ index fb47942c9..b00a24792 100644
/**
* wpa_supplicant_add_iface - Add a new network interface
@@ -7364,6 +7368,8 @@ struct wpa_global * wpa_supplicant_init(struct wpa_params *params)
@@ -6389,6 +6393,8 @@ struct wpa_global * wpa_supplicant_init(struct wpa_params *params)
#ifndef CONFIG_NO_WPA_MSG
wpa_msg_register_ifname_cb(wpa_supplicant_msg_ifname_cb);
#endif /* CONFIG_NO_WPA_MSG */

View File

@ -1,6 +1,6 @@
From 1a55572f699610d356997da020bcfb65da6d2dc5 Mon Sep 17 00:00:00 2001
From e8bf6ea2fbcbcff612b6adf93cb5fcdf86f0c4a0 Mon Sep 17 00:00:00 2001
From: Patrick Walther <patrick.walther@netmodule.com>
Date: Fri, 24 Jul 2020 14:41:09 +0200
Date: Tue, 28 Jan 2020 15:14:35 +0100
---
hostapd/config_file.c | 4 ++++
@ -10,13 +10,13 @@ Date: Fri, 24 Jul 2020 14:41:09 +0200
4 files changed, 14 insertions(+), 1 deletion(-)
diff --git a/hostapd/config_file.c b/hostapd/config_file.c
index 8a86ce08b..03b902076 100644
index e09e6e141..625104831 100644
--- a/hostapd/config_file.c
+++ b/hostapd/config_file.c
@@ -3435,6 +3435,10 @@ static int hostapd_config_fill(struct hostapd_config *conf,
if (bss->ocv && !bss->ieee80211w)
@@ -3411,6 +3411,10 @@ static int hostapd_config_fill(struct hostapd_config *conf,
bss->ieee80211w = 1;
#endif /* CONFIG_OCV */
#ifdef CONFIG_IEEE80211N
+ } else if (os_strcmp(buf, "noscan") == 0) {
+ conf->noscan = atoi(pos);
+ } else if (os_strcmp(buf, "ht_coex") == 0) {
@ -25,10 +25,10 @@ index 8a86ce08b..03b902076 100644
conf->ieee80211n = atoi(pos);
} else if (os_strcmp(buf, "ht_capab") == 0) {
diff --git a/src/ap/ap_config.h b/src/ap/ap_config.h
index 805ea93df..58dd2cfed 100644
index cfe59d4b4..826030666 100644
--- a/src/ap/ap_config.h
+++ b/src/ap/ap_config.h
@@ -1040,6 +1040,8 @@ struct hostapd_config {
@@ -934,6 +934,8 @@ struct hostapd_config {
int ht_op_mode_fixed;
u16 ht_capab;
@ -38,10 +38,10 @@ index 805ea93df..58dd2cfed 100644
int secondary_channel;
int no_pri_sec_switch;
diff --git a/src/ap/hw_features.c b/src/ap/hw_features.c
index 4b66b02f4..2b66ab563 100644
index c1f19e26b..993f0d035 100644
--- a/src/ap/hw_features.c
+++ b/src/ap/hw_features.c
@@ -517,7 +517,8 @@ static int ieee80211n_check_40mhz(struct hostapd_iface *iface)
@@ -477,7 +477,8 @@ static int ieee80211n_check_40mhz(struct hostapd_iface *iface)
int ret;
/* Check that HT40 is used and PRI / SEC switch is allowed */
@ -52,10 +52,10 @@ index 4b66b02f4..2b66ab563 100644
hostapd_set_state(iface, HAPD_IFACE_HT_SCAN);
diff --git a/src/ap/ieee802_11_ht.c b/src/ap/ieee802_11_ht.c
index 59ecbdce7..ebe2e5acd 100644
index 214855dcc..3697ca331 100644
--- a/src/ap/ieee802_11_ht.c
+++ b/src/ap/ieee802_11_ht.c
@@ -230,6 +230,9 @@ void hostapd_2040_coex_action(struct hostapd_data *hapd,
@@ -252,6 +252,9 @@ void hostapd_2040_coex_action(struct hostapd_data *hapd,
return;
}
@ -65,7 +65,7 @@ index 59ecbdce7..ebe2e5acd 100644
if (len < IEEE80211_HDRLEN + 2 + sizeof(*bc_ie)) {
wpa_printf(MSG_DEBUG,
"Ignore too short 20/40 BSS Coexistence Management frame");
@@ -390,6 +393,9 @@ void ht40_intolerant_add(struct hostapd_iface *iface, struct sta_info *sta)
@@ -412,6 +415,9 @@ void ht40_intolerant_add(struct hostapd_iface *iface, struct sta_info *sta)
if (iface->current_mode->mode != HOSTAPD_MODE_IEEE80211G)
return;

View File

@ -1,6 +1,6 @@
From 0c333b13dfbf5a04e94cda26948e5dc48803e723 Mon Sep 17 00:00:00 2001
From e22b3c8a6ed6f4dec3700fd5bb6b719888d91d91 Mon Sep 17 00:00:00 2001
From: Patrick Walther <patrick.walther@netmodule.com>
Date: Fri, 24 Jul 2020 14:41:09 +0200
Date: Tue, 28 Jan 2020 15:14:35 +0100
---
wpa_supplicant/config.c | 1 +
@ -11,10 +11,10 @@ Date: Fri, 24 Jul 2020 14:41:09 +0200
5 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/wpa_supplicant/config.c b/wpa_supplicant/config.c
index bfbc46000..ec8301ab9 100644
index 07ed344e4..eaabaa88d 100644
--- a/wpa_supplicant/config.c
+++ b/wpa_supplicant/config.c
@@ -2531,6 +2531,7 @@ static const struct parse_data ssid_fields[] = {
@@ -2312,6 +2312,7 @@ static const struct parse_data ssid_fields[] = {
#else /* CONFIG_MESH */
{ INT_RANGE(mode, 0, 4) },
#endif /* CONFIG_MESH */
@ -23,22 +23,22 @@ index bfbc46000..ec8301ab9 100644
{ INT_RANGE(disabled, 0, 2) },
{ STR(id_str) },
diff --git a/wpa_supplicant/config_file.c b/wpa_supplicant/config_file.c
index c0763253f..93fc014e4 100644
index 7050a1ae6..f4a397fe3 100644
--- a/wpa_supplicant/config_file.c
+++ b/wpa_supplicant/config_file.c
@@ -766,6 +766,7 @@ static void wpa_config_write_network(FILE *f, struct wpa_ssid *ssid)
@@ -829,6 +829,7 @@ static void wpa_config_write_network(FILE *f, struct wpa_ssid *ssid)
#endif /* IEEE8021X_EAPOL */
INT(mode);
INT(no_auto_peer);
+ INT(noscan);
INT(mesh_fwding);
INT(frequency);
INT(enable_edmg);
INT(fixed_freq);
diff --git a/wpa_supplicant/config_ssid.h b/wpa_supplicant/config_ssid.h
index 9b17c3b14..d5c90122a 100644
index a052390ad..401c22cec 100644
--- a/wpa_supplicant/config_ssid.h
+++ b/wpa_supplicant/config_ssid.h
@@ -981,6 +981,8 @@ struct wpa_ssid {
@@ -918,6 +918,8 @@ struct wpa_ssid {
*/
int no_auto_peer;
@ -48,33 +48,30 @@ index 9b17c3b14..d5c90122a 100644
* mesh_rssi_threshold - Set mesh parameter mesh_rssi_threshold (dBm)
*
diff --git a/wpa_supplicant/mesh.c b/wpa_supplicant/mesh.c
index b67396d5a..ad067da67 100644
index fa39e60bb..6f54ff764 100644
--- a/wpa_supplicant/mesh.c
+++ b/wpa_supplicant/mesh.c
@@ -506,6 +506,8 @@ static int wpa_supplicant_mesh_init(struct wpa_supplicant *wpa_s,
@@ -361,6 +361,8 @@ static int wpa_supplicant_mesh_init(struct wpa_supplicant *wpa_s,
frequency);
goto out_free;
}
+ if (ssid->noscan)
+ conf->noscan = 1;
if (ssid->mesh_basic_rates == NULL) {
/*
if (ssid->ht40)
conf->secondary_channel = ssid->ht40;
if (conf->hw_mode == HOSTAPD_MODE_IEEE80211A && ssid->vht) {
diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c
index b00a24792..bc2d4012d 100644
index 4f95917c6..70161d272 100644
--- a/wpa_supplicant/wpa_supplicant.c
+++ b/wpa_supplicant/wpa_supplicant.c
@@ -2452,7 +2452,7 @@ void ibss_mesh_setup_freq(struct wpa_supplicant *wpa_s,
@@ -2143,12 +2143,12 @@ void ibss_mesh_setup_freq(struct wpa_supplicant *wpa_s,
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 bw80[] = { 5180, 5260, 5500, 5580, 5660, 5745, 5955,
6035, 6115, 6195, 6275, 6355, 6435, 6515,
@@ -2460,7 +2460,7 @@ void ibss_mesh_setup_freq(struct wpa_supplicant *wpa_s,
int bw160[] = { 5955, 6115, 6275, 6435, 6595, 6755, 6915 };
int vht80[] = { 36, 52, 100, 116, 132, 149 };
struct hostapd_channel_data *pri_chan = NULL, *sec_chan = NULL;
u8 channel;
- int i, chan_idx, ht40 = -1, res, obss_scan = 1;
@ -82,8 +79,8 @@ index b00a24792..bc2d4012d 100644
unsigned int j, k;
struct hostapd_freq_params vht_freq;
int chwidth, seg0, seg1;
@@ -2551,7 +2551,7 @@ void ibss_mesh_setup_freq(struct wpa_supplicant *wpa_s,
#endif /* CONFIG_HE_OVERRIDES */
@@ -2221,7 +2221,7 @@ void ibss_mesh_setup_freq(struct wpa_supplicant *wpa_s,
return;
/* Setup higher BW only for 5 GHz */
- if (mode->mode != HOSTAPD_MODE_IEEE80211A)

View File

@ -1,16 +1,16 @@
From f9584fa25cb679943e978926af83dcb17597a76c Mon Sep 17 00:00:00 2001
From 9836c7637ca362ab893b3f5f12ec123daf36ef37 Mon Sep 17 00:00:00 2001
From: Patrick Walther <patrick.walther@netmodule.com>
Date: Fri, 24 Jul 2020 14:41:09 +0200
Date: Tue, 28 Jan 2020 15:14:35 +0100
---
wpa_supplicant/wpa_supplicant.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c
index bc2d4012d..c31421c3e 100644
index 70161d272..92ddbe458 100644
--- a/wpa_supplicant/wpa_supplicant.c
+++ b/wpa_supplicant/wpa_supplicant.c
@@ -5405,7 +5405,7 @@ wpa_supplicant_alloc(struct wpa_supplicant *parent)
@@ -4474,7 +4474,7 @@ wpa_supplicant_alloc(struct wpa_supplicant *parent)
if (wpa_s == NULL)
return NULL;
wpa_s->scan_req = INITIAL_SCAN_REQ;

View File

@ -1,6 +1,6 @@
From 20b84122399e878194d5757bbe637c4fed6d0f2e Mon Sep 17 00:00:00 2001
From c029de2c61fbc74f39362bdcfe46bf39cde33b17 Mon Sep 17 00:00:00 2001
From: Patrick Walther <patrick.walther@netmodule.com>
Date: Fri, 24 Jul 2020 14:41:09 +0200
Date: Tue, 28 Jan 2020 15:14:35 +0100
---
src/drivers/drivers.mak | 4 +---
@ -8,10 +8,10 @@ Date: Fri, 24 Jul 2020 14:41:09 +0200
2 files changed, 17 insertions(+), 3 deletions(-)
diff --git a/src/drivers/drivers.mak b/src/drivers/drivers.mak
index a03d4a034..8da44d9f5 100644
index 442c59cf4..da17ccc51 100644
--- a/src/drivers/drivers.mak
+++ b/src/drivers/drivers.mak
@@ -54,7 +54,6 @@ NEED_SME=y
@@ -50,7 +50,6 @@ NEED_SME=y
NEED_AP_MLME=y
NEED_NETLINK=y
NEED_LINUX_IOCTL=y
@ -19,7 +19,7 @@ index a03d4a034..8da44d9f5 100644
NEED_RADIOTAP=y
NEED_LIBNL=y
endif
@@ -111,7 +110,6 @@ DRV_WPA_CFLAGS += -DCONFIG_DRIVER_WEXT
@@ -107,7 +106,6 @@ DRV_WPA_CFLAGS += -DCONFIG_DRIVER_WEXT
CONFIG_WIRELESS_EXTENSION=y
NEED_NETLINK=y
NEED_LINUX_IOCTL=y
@ -27,7 +27,7 @@ index a03d4a034..8da44d9f5 100644
endif
ifdef CONFIG_DRIVER_NDIS
@@ -137,7 +135,6 @@ endif
@@ -133,7 +131,6 @@ endif
ifdef CONFIG_WIRELESS_EXTENSION
DRV_WPA_CFLAGS += -DCONFIG_WIRELESS_EXTENSION
DRV_WPA_OBJS += ../src/drivers/driver_wext.o

View File

@ -1,18 +1,18 @@
From 7fafab3b02af33cb9cbb4c1ea7de83cfc6161a4a Mon Sep 17 00:00:00 2001
From ea5e8082aadcdbf23397cdb3dbd1b1f8aeff78d2 Mon Sep 17 00:00:00 2001
From: Patrick Walther <patrick.walther@netmodule.com>
Date: Fri, 24 Jul 2020 14:41:09 +0200
Date: Tue, 28 Jan 2020 15:14:35 +0100
---
src/drivers/driver_nl80211.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
index de6a6c2f6..d2b30a0b8 100644
index 2930b01b4..d0f79ca4b 100644
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
@@ -5011,7 +5011,7 @@ static int nl80211_set_channel(struct i802_bss *bss,
freq->he_enabled, freq->eht_enabled, freq->bandwidth,
freq->center_freq1, freq->center_freq2);
@@ -4431,7 +4431,7 @@ static int nl80211_set_channel(struct i802_bss *bss,
freq->freq, freq->ht_enabled, freq->vht_enabled, freq->he_enabled,
freq->bandwidth, freq->center_freq1, freq->center_freq2);
- msg = nl80211_drv_msg(drv, 0, set_chan ? NL80211_CMD_SET_CHANNEL :
+ msg = nl80211_bss_msg(bss, 0, set_chan ? NL80211_CMD_SET_CHANNEL :

View File

@ -1,28 +1,25 @@
From a8e0a04a432c75c828a5ed0a56de0de2a3ea558f Mon Sep 17 00:00:00 2001
From ad010c95defeaded858c4d37004911a7cb31f199 Mon Sep 17 00:00:00 2001
From: Patrick Walther <patrick.walther@netmodule.com>
Date: Fri, 24 Jul 2020 14:41:09 +0200
Date: Tue, 28 Jan 2020 15:14:35 +0100
---
src/ap/hostapd.c | 50 +++++++++++++++++++++++++++++++++---------------
1 file changed, 35 insertions(+), 15 deletions(-)
src/ap/hostapd.c | 47 ++++++++++++++++++++++++++++++++---------------
1 file changed, 32 insertions(+), 15 deletions(-)
diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c
index 2b07a9283..f6c9c0e78 100644
index c85563353..9227a1f01 100644
--- a/src/ap/hostapd.c
+++ b/src/ap/hostapd.c
@@ -119,6 +119,29 @@ static void hostapd_reload_bss(struct hostapd_data *hapd)
@@ -108,6 +108,26 @@ static void hostapd_reload_bss(struct hostapd_data *hapd)
#endif /* CONFIG_NO_RADIUS */
ssid = &hapd->conf->ssid;
+
+ hostapd_set_freq(hapd, hapd->iconf->hw_mode, hapd->iface->freq,
+ hapd->iconf->channel,
+ hapd->iconf->enable_edmg,
+ hapd->iconf->edmg_channel,
+ hapd->iconf->ieee80211n,
+ hapd->iconf->ieee80211ac,
+ hapd->iconf->ieee80211ax,
+ hapd->iconf->ieee80211be,
+ hapd->iconf->secondary_channel,
+ hostapd_get_oper_chwidth(hapd->iconf),
+ hostapd_get_oper_centr_freq_seg0_idx(hapd->iconf),
@ -40,7 +37,7 @@ index 2b07a9283..f6c9c0e78 100644
if (!ssid->wpa_psk_set && ssid->wpa_psk && !ssid->wpa_psk->next &&
ssid->wpa_passphrase_set && ssid->wpa_passphrase) {
/*
@@ -220,6 +243,7 @@ int hostapd_reload_config(struct hostapd_iface *iface)
@@ -205,6 +225,7 @@ int hostapd_reload_config(struct hostapd_iface *iface)
struct hostapd_data *hapd = iface->bss[0];
struct hostapd_config *newconf, *oldconf;
size_t j;
@ -48,7 +45,7 @@ index 2b07a9283..f6c9c0e78 100644
if (iface->config_fname == NULL) {
/* Only in-memory config in use - assume it has been updated */
@@ -270,24 +294,20 @@ int hostapd_reload_config(struct hostapd_iface *iface)
@@ -255,24 +276,20 @@ int hostapd_reload_config(struct hostapd_iface *iface)
}
iface->conf = newconf;

View File

@ -1,16 +1,16 @@
From 2aeb1ad361356c6eca3101b00cd323490ad7d55a Mon Sep 17 00:00:00 2001
From 24c05db1628be8bfbdb0caf70acf3e86e943becc Mon Sep 17 00:00:00 2001
From: Patrick Walther <patrick.walther@netmodule.com>
Date: Fri, 24 Jul 2020 14:41:09 +0200
Date: Tue, 28 Jan 2020 15:14:35 +0100
---
wpa_supplicant/ap.c | 22 +++++++++++++++++++++-
1 file changed, 21 insertions(+), 1 deletion(-)
diff --git a/wpa_supplicant/ap.c b/wpa_supplicant/ap.c
index 52b537e62..f21b8713f 100644
index 4e3c2814d..5af4be230 100644
--- a/wpa_supplicant/ap.c
+++ b/wpa_supplicant/ap.c
@@ -1803,15 +1803,35 @@ int ap_switch_channel(struct wpa_supplicant *wpa_s,
@@ -1378,15 +1378,35 @@ int ap_switch_channel(struct wpa_supplicant *wpa_s,
#ifdef CONFIG_CTRL_IFACE

View File

@ -1,30 +1,34 @@
From e89b089b1b199a7332e704de84f261c437d9f510 Mon Sep 17 00:00:00 2001
From c2031863a036db040f11a21b7093afb4e2322b91 Mon Sep 17 00:00:00 2001
From: Patrick Walther <patrick.walther@netmodule.com>
Date: Fri, 24 Jul 2020 14:41:09 +0200
Date: Tue, 28 Jan 2020 15:14:35 +0100
---
src/drivers/driver_nl80211.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
src/drivers/driver_nl80211.c | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
index d2b30a0b8..a9ae0fbe2 100644
index d0f79ca4b..0cdcca66f 100644
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
@@ -2932,11 +2932,11 @@ static int wpa_driver_nl80211_del_beacon(struct i802_bss *bss)
@@ -2721,10 +2721,15 @@ static int wpa_driver_nl80211_del_beacon(struct i802_bss *bss)
struct nl_msg *msg;
struct wpa_driver_nl80211_data *drv = bss->drv;
+ if (!bss->beacon_set)
+ return 0;
+
+ bss->beacon_set = 0;
+
wpa_printf(MSG_DEBUG, "nl80211: Remove beacon (ifindex=%d)",
- drv->ifindex);
+ bss->ifindex);
bss->beacon_set = 0;
bss->freq = 0;
nl80211_put_wiphy_data_ap(bss);
- msg = nl80211_drv_msg(drv, 0, NL80211_CMD_DEL_BEACON);
+ msg = nl80211_bss_msg(drv, 0, NL80211_CMD_DEL_BEACON);
return send_and_recv_msgs(drv, msg, NULL, NULL, NULL, NULL);
+ msg = nl80211_bss_msg(bss, 0, NL80211_CMD_DEL_BEACON);
return send_and_recv_msgs(drv, msg, NULL, NULL);
}
@@ -5650,7 +5650,7 @@ static void nl80211_teardown_ap(struct i802_bss *bss)
@@ -5042,7 +5047,7 @@ static void nl80211_teardown_ap(struct i802_bss *bss)
nl80211_mgmt_unsubscribe(bss, "AP teardown");
nl80211_put_wiphy_data_ap(bss);
@ -33,7 +37,7 @@ index d2b30a0b8..a9ae0fbe2 100644
}
@@ -8104,8 +8104,6 @@ static int wpa_driver_nl80211_if_remove(struct i802_bss *bss,
@@ -7353,8 +7358,6 @@ static int wpa_driver_nl80211_if_remove(struct i802_bss *bss,
} else {
wpa_printf(MSG_DEBUG, "nl80211: First BSS - reassign context");
nl80211_teardown_ap(bss);
@ -42,3 +46,19 @@ index d2b30a0b8..a9ae0fbe2 100644
nl80211_destroy_bss(bss);
if (!bss->added_if)
i802_set_iface_flags(bss, 0);
@@ -7744,7 +7747,6 @@ static int wpa_driver_nl80211_deinit_ap(void *priv)
if (!is_ap_interface(drv->nlmode))
return -1;
wpa_driver_nl80211_del_beacon(bss);
- bss->beacon_set = 0;
/*
* If the P2P GO interface was dynamically added, then it is
@@ -7764,7 +7766,6 @@ static int wpa_driver_nl80211_stop_ap(void *priv)
if (!is_ap_interface(drv->nlmode))
return -1;
wpa_driver_nl80211_del_beacon(bss);
- bss->beacon_set = 0;
return 0;
}

View File

@ -1,17 +1,17 @@
From e949a35332f665fb789e2c4a07cfdacd635e67b8 Mon Sep 17 00:00:00 2001
From 4301f343aad50fc07a271d1bca6ec265089c607e Mon Sep 17 00:00:00 2001
From: Patrick Walther <patrick.walther@netmodule.com>
Date: Fri, 24 Jul 2020 14:41:09 +0200
Date: Tue, 28 Jan 2020 15:14:35 +0100
---
hostapd/ctrl_iface.c | 59 ++++++++++++++++++++++++++++++++++++++++++
src/ap/ctrl_iface_ap.c | 8 +++++-
hostapd/ctrl_iface.c | 59 ++++++++++++++++++++++++++++++++++++++++++++++++++
src/ap/ctrl_iface_ap.c | 8 ++++++-
2 files changed, 66 insertions(+), 1 deletion(-)
diff --git a/hostapd/ctrl_iface.c b/hostapd/ctrl_iface.c
index 664c59df7..8baa4a4d4 100644
index 0f6dfa13d..35c00bd0d 100644
--- a/hostapd/ctrl_iface.c
+++ b/hostapd/ctrl_iface.c
@@ -67,6 +67,7 @@
@@ -60,6 +60,7 @@
#include "fst/fst_ctrl_iface.h"
#include "config_file.h"
#include "ctrl_iface.h"
@ -19,7 +19,7 @@ index 664c59df7..8baa4a4d4 100644
#define HOSTAPD_CLI_DUP_VALUE_MAX_LEN 256
@@ -82,6 +83,7 @@ static void hostapd_ctrl_iface_send(struct hostapd_data *hapd, int level,
@@ -78,6 +79,7 @@ static void hostapd_ctrl_iface_send(struct hostapd_data *hapd, int level,
enum wpa_msg_type type,
const char *buf, size_t len);
@ -27,7 +27,7 @@ index 664c59df7..8baa4a4d4 100644
static int hostapd_ctrl_iface_attach(struct hostapd_data *hapd,
struct sockaddr_storage *from,
@@ -133,6 +135,61 @@ static int hostapd_ctrl_iface_new_sta(struct hostapd_data *hapd,
@@ -129,6 +131,61 @@ static int hostapd_ctrl_iface_new_sta(struct hostapd_data *hapd,
return 0;
}
@ -87,9 +87,9 @@ index 664c59df7..8baa4a4d4 100644
+ iface->interfaces->config_read_cb = config_read_cb;
+}
#ifdef CONFIG_IEEE80211W
#ifdef NEED_AP_MLME
static int hostapd_ctrl_iface_sa_query(struct hostapd_data *hapd,
@@ -3434,6 +3491,8 @@ static int hostapd_ctrl_iface_receive_process(struct hostapd_data *hapd,
@@ -3195,6 +3252,8 @@ static int hostapd_ctrl_iface_receive_process(struct hostapd_data *hapd,
} else if (os_strncmp(buf, "VENDOR ", 7) == 0) {
reply_len = hostapd_ctrl_iface_vendor(hapd, buf + 7, reply,
reply_size);
@ -99,10 +99,10 @@ index 664c59df7..8baa4a4d4 100644
ieee802_1x_erp_flush(hapd);
#ifdef RADIUS_SERVER
diff --git a/src/ap/ctrl_iface_ap.c b/src/ap/ctrl_iface_ap.c
index 29b41f5bc..5150d9bbf 100644
index 2c4953d8b..1135e8151 100644
--- a/src/ap/ctrl_iface_ap.c
+++ b/src/ap/ctrl_iface_ap.c
@@ -945,7 +945,13 @@ int hostapd_parse_csa_settings(const char *pos,
@@ -874,7 +874,13 @@ int hostapd_parse_csa_settings(const char *pos,
int hostapd_ctrl_iface_stop_ap(struct hostapd_data *hapd)
{

View File

@ -1,45 +1,44 @@
From d1928a9eedc0ce358521d6681c7f61d2e0da1316 Mon Sep 17 00:00:00 2001
From 58cace2f15271782798fa574d27fd4a57b64729b Mon Sep 17 00:00:00 2001
From: Patrick Walther <patrick.walther@netmodule.com>
Date: Fri, 24 Jul 2020 14:41:09 +0200
Date: Tue, 28 Jan 2020 15:14:35 +0100
---
hostapd/ctrl_iface.c | 6 +++
hostapd/ctrl_iface.c | 5 +++
src/ap/beacon.c | 5 ---
src/drivers/driver.h | 2 +
src/drivers/driver_nl80211_event.c | 6 ++-
wpa_supplicant/Makefile | 2 +
wpa_supplicant/bss.c | 14 ++++++
wpa_supplicant/bss.h | 4 ++
wpa_supplicant/events.c | 58 ++++++++++++++++++++++++-
wpa_supplicant/main.c | 8 +++-
wpa_supplicant/wpa_supplicant.c | 69 ++++++++++++++++++++++++++++++
wpa_supplicant/wpa_supplicant_i.h | 7 +++
11 files changed, 172 insertions(+), 9 deletions(-)
src/drivers/driver.h | 2 ++
src/drivers/driver_nl80211_event.c | 6 +++-
wpa_supplicant/Makefile | 6 ++++
wpa_supplicant/bss.c | 14 ++++++++
wpa_supplicant/bss.h | 4 +++
wpa_supplicant/events.c | 58 ++++++++++++++++++++++++++++++-
wpa_supplicant/main.c | 8 +++--
wpa_supplicant/wpa_supplicant.c | 70 ++++++++++++++++++++++++++++++++++++++
wpa_supplicant/wpa_supplicant_i.h | 7 ++++
11 files changed, 176 insertions(+), 9 deletions(-)
diff --git a/hostapd/ctrl_iface.c b/hostapd/ctrl_iface.c
index 8baa4a4d4..193df6e11 100644
index 35c00bd0d..cc4f64226 100644
--- a/hostapd/ctrl_iface.c
+++ b/hostapd/ctrl_iface.c
@@ -2626,6 +2626,12 @@ static int hostapd_ctrl_iface_chan_switch(struct hostapd_iface *iface,
return 0;
}
@@ -2408,6 +2408,11 @@ static int hostapd_ctrl_iface_chan_switch(struct hostapd_iface *iface,
if (ret)
return ret;
+ if (os_strstr(pos, " auto-ht")) {
+ settings.freq_params.ht_enabled = iface->conf->ieee80211n;
+ settings.freq_params.vht_enabled = iface->conf->ieee80211ac;
+ settings.freq_params.he_enabled = iface->conf->ieee80211ax;
+ }
+
for (i = 0; i < iface->num_bss; i++) {
/* Save CHAN_SWITCH VHT, HE, and EHT config */
/* Save CHAN_SWITCH VHT config */
diff --git a/src/ap/beacon.c b/src/ap/beacon.c
index 58872bfda..c8a0e51d3 100644
index a51b94960..5039fc0e7 100644
--- a/src/ap/beacon.c
+++ b/src/ap/beacon.c
@@ -1901,11 +1901,6 @@ static int __ieee802_11_set_beacon(struct hostapd_data *hapd)
return -1;
}
@@ -1403,11 +1403,6 @@ int ieee802_11_set_beacon(struct hostapd_data *hapd)
struct wpabuf *beacon, *proberesp, *assocresp;
int res, ret = -1;
- if (hapd->csa_in_progress) {
- wpa_printf(MSG_ERROR, "Cannot set beacons during CSA period");
@ -50,10 +49,10 @@ index 58872bfda..c8a0e51d3 100644
if (ieee802_11_build_ap_params(hapd, &params) < 0)
diff --git a/src/drivers/driver.h b/src/drivers/driver.h
index f8f91c023..f7dfcc165 100644
index f35e3fdad..a383af19f 100644
--- a/src/drivers/driver.h
+++ b/src/drivers/driver.h
@@ -5965,6 +5965,7 @@ union wpa_event_data {
@@ -5478,6 +5478,7 @@ union wpa_event_data {
/**
* struct ch_switch
@ -61,7 +60,7 @@ index f8f91c023..f7dfcc165 100644
* @freq: Frequency of new channel in MHz
* @ht_enabled: Whether this is an HT channel
* @ch_offset: Secondary channel offset
@@ -5973,6 +5974,7 @@ union wpa_event_data {
@@ -5486,6 +5487,7 @@ union wpa_event_data {
* @cf2: Center frequency 2
*/
struct ch_switch {
@ -70,10 +69,10 @@ index f8f91c023..f7dfcc165 100644
int ht_enabled;
int ch_offset;
diff --git a/src/drivers/driver_nl80211_event.c b/src/drivers/driver_nl80211_event.c
index 00f8b0cbb..a67b4818a 100644
index 7c1633066..f074e7ba5 100644
--- a/src/drivers/driver_nl80211_event.c
+++ b/src/drivers/driver_nl80211_event.c
@@ -691,7 +691,7 @@ static void mlme_event_ch_switch(struct wpa_driver_nl80211_data *drv,
@@ -536,7 +536,7 @@ static void mlme_event_ch_switch(struct wpa_driver_nl80211_data *drv,
struct nlattr *ifindex, struct nlattr *freq,
struct nlattr *type, struct nlattr *bw,
struct nlattr *cf1, struct nlattr *cf2,
@ -82,7 +81,7 @@ index 00f8b0cbb..a67b4818a 100644
{
struct i802_bss *bss;
union wpa_event_data data;
@@ -752,6 +752,8 @@ static void mlme_event_ch_switch(struct wpa_driver_nl80211_data *drv,
@@ -595,6 +595,8 @@ static void mlme_event_ch_switch(struct wpa_driver_nl80211_data *drv,
data.ch_switch.cf1 = nla_get_u32(cf1);
if (cf2)
data.ch_switch.cf2 = nla_get_u32(cf2);
@ -91,7 +90,7 @@ index 00f8b0cbb..a67b4818a 100644
if (finished)
bss->freq = data.ch_switch.freq;
@@ -3115,6 +3117,7 @@ static void do_process_drv_event(struct i802_bss *bss, int cmd,
@@ -2544,6 +2546,7 @@ static void do_process_drv_event(struct i802_bss *bss, int cmd,
tb[NL80211_ATTR_CHANNEL_WIDTH],
tb[NL80211_ATTR_CENTER_FREQ1],
tb[NL80211_ATTR_CENTER_FREQ2],
@ -99,7 +98,7 @@ index 00f8b0cbb..a67b4818a 100644
0);
break;
case NL80211_CMD_CH_SWITCH_NOTIFY:
@@ -3125,6 +3128,7 @@ static void do_process_drv_event(struct i802_bss *bss, int cmd,
@@ -2554,6 +2557,7 @@ static void do_process_drv_event(struct i802_bss *bss, int cmd,
tb[NL80211_ATTR_CHANNEL_WIDTH],
tb[NL80211_ATTR_CENTER_FREQ1],
tb[NL80211_ATTR_CENTER_FREQ2],
@ -108,10 +107,21 @@ index 00f8b0cbb..a67b4818a 100644
break;
case NL80211_CMD_DISCONNECT:
diff --git a/wpa_supplicant/Makefile b/wpa_supplicant/Makefile
index f7740e6f0..969dc713f 100644
index 3d05870bd..d8e42fe2f 100644
--- a/wpa_supplicant/Makefile
+++ b/wpa_supplicant/Makefile
@@ -115,6 +115,8 @@ OBJS_c += ../src/utils/common.o
@@ -26,6 +26,10 @@ CFLAGS += $(EXTRA_CFLAGS)
CFLAGS += -I$(abspath ../src)
CFLAGS += -I$(abspath ../src/utils)
+ifdef MULTICALL
+CFLAGS += -DMULTICALL
+endif
+
-include .config
-include $(if $(MULTICALL),../hostapd/.config)
@@ -116,6 +120,8 @@ OBJS_c += ../src/utils/common.o
OBJS_c += ../src/common/cli.o
OBJS += wmm_ac.o
@ -121,7 +131,7 @@ index f7740e6f0..969dc713f 100644
ifdef CONFIG_NATIVE_WINDOWS
CONFIG_OS=win32
diff --git a/wpa_supplicant/bss.c b/wpa_supplicant/bss.c
index eb97a618d..01ddb13ec 100644
index 441529cb0..e5dd06a80 100644
--- a/wpa_supplicant/bss.c
+++ b/wpa_supplicant/bss.c
@@ -11,6 +11,7 @@
@ -132,7 +142,7 @@ index eb97a618d..01ddb13ec 100644
#include "drivers/driver.h"
#include "eap_peer/eap.h"
#include "wpa_supplicant_i.h"
@@ -282,6 +283,10 @@ void calculate_update_time(const struct os_reltime *fetch_time,
@@ -294,6 +295,10 @@ void calculate_update_time(const struct os_reltime *fetch_time,
static void wpa_bss_copy_res(struct wpa_bss *dst, struct wpa_scan_res *src,
struct os_reltime *fetch_time)
{
@ -143,7 +153,7 @@ index eb97a618d..01ddb13ec 100644
dst->flags = src->flags;
os_memcpy(dst->bssid, src->bssid, ETH_ALEN);
dst->freq = src->freq;
@@ -295,6 +300,15 @@ static void wpa_bss_copy_res(struct wpa_bss *dst, struct wpa_scan_res *src,
@@ -306,6 +311,15 @@ static void wpa_bss_copy_res(struct wpa_bss *dst, struct wpa_scan_res *src,
dst->est_throughput = src->est_throughput;
dst->snr = src->snr;
@ -160,10 +170,10 @@ index eb97a618d..01ddb13ec 100644
}
diff --git a/wpa_supplicant/bss.h b/wpa_supplicant/bss.h
index 146aaee7f..2f37e8d1c 100644
index 3ce8cd3f4..50c498612 100644
--- a/wpa_supplicant/bss.h
+++ b/wpa_supplicant/bss.h
@@ -94,6 +94,10 @@ struct wpa_bss {
@@ -82,6 +82,10 @@ struct wpa_bss {
u8 ssid[SSID_MAX_LEN];
/** Length of SSID */
size_t ssid_len;
@ -175,10 +185,10 @@ index 146aaee7f..2f37e8d1c 100644
int freq;
/** Beacon interval in TUs (host byte order) */
diff --git a/wpa_supplicant/events.c b/wpa_supplicant/events.c
index 48aa792b3..86a0dc7fa 100644
index 067f76b48..7891f1ba1 100644
--- a/wpa_supplicant/events.c
+++ b/wpa_supplicant/events.c
@@ -4953,6 +4953,60 @@ static void wpas_event_unprot_beacon(struct wpa_supplicant *wpa_s,
@@ -4184,6 +4184,60 @@ static void wpas_event_assoc_reject(struct wpa_supplicant *wpa_s,
}
@ -239,7 +249,7 @@ index 48aa792b3..86a0dc7fa 100644
void supplicant_event(void *ctx, enum wpa_event_type event,
union wpa_event_data *data)
{
@@ -5268,8 +5322,10 @@ void supplicant_event(void *ctx, enum wpa_event_type event,
@@ -4485,8 +4539,10 @@ void supplicant_event(void *ctx, enum wpa_event_type event,
channel_width_to_string(data->ch_switch.ch_width),
data->ch_switch.cf1,
data->ch_switch.cf2);
@ -252,10 +262,10 @@ index 48aa792b3..86a0dc7fa 100644
wpa_s->assoc_freq = data->ch_switch.freq;
wpa_s->current_ssid->frequency = data->ch_switch.freq;
diff --git a/wpa_supplicant/main.c b/wpa_supplicant/main.c
index 9229eb51f..535923ecd 100644
index 51a8a0298..669f5b0b6 100644
--- a/wpa_supplicant/main.c
+++ b/wpa_supplicant/main.c
@@ -35,7 +35,7 @@ static void usage(void)
@@ -34,7 +34,7 @@ static void usage(void)
"vW] [-P<pid file>] "
"[-g<global ctrl>] \\\n"
" [-G<group>] \\\n"
@ -264,7 +274,7 @@ index 9229eb51f..535923ecd 100644
"[-p<driver_param>] \\\n"
" [-b<br_ifname>] [-e<entropy file>]"
#ifdef CONFIG_DEBUG_FILE
@@ -75,6 +75,7 @@ static void usage(void)
@@ -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"
@ -272,7 +282,7 @@ index 9229eb51f..535923ecd 100644
" -i = interface name\n"
" -I = additional configuration file\n"
" -K = include keys (passwords, etc.) in debug output\n"
@@ -202,7 +203,7 @@ int main(int argc, char *argv[])
@@ -201,7 +202,7 @@ int main(int argc, char *argv[])
for (;;) {
c = getopt(argc, argv,
@ -281,7 +291,7 @@ index 9229eb51f..535923ecd 100644
if (c < 0)
break;
switch (c) {
@@ -249,6 +250,9 @@ int main(int argc, char *argv[])
@@ -248,6 +249,9 @@ int main(int argc, char *argv[])
usage();
exitcode = 0;
goto out;
@ -292,12 +302,12 @@ index 9229eb51f..535923ecd 100644
iface->ifname = optarg;
break;
diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c
index c31421c3e..c18723384 100644
index 92ddbe458..c91a5ab10 100644
--- a/wpa_supplicant/wpa_supplicant.c
+++ b/wpa_supplicant/wpa_supplicant.c
@@ -131,6 +131,54 @@ static void wpas_update_fils_connect_params(struct wpa_supplicant *wpa_s);
static void wpas_update_owe_connect_params(struct wpa_supplicant *wpa_s);
#endif /* CONFIG_OWE */
@@ -127,6 +127,55 @@ static void wpas_update_fils_connect_params(struct wpa_supplicant *wpa_s);
#endif /* CONFIG_FILS && IEEE8021X_EAPOL */
+static int hostapd_stop(struct wpa_supplicant *wpa_s)
+{
@ -347,10 +357,11 @@ index c31421c3e..c18723384 100644
+ }
+ return 0;
+}
#ifdef CONFIG_WEP
+
/* Configure default/group WEP keys for static WEP */
@@ -1016,6 +1064,8 @@ void wpa_supplicant_set_state(struct wpa_supplicant *wpa_s,
int wpa_set_wep_keys(struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid)
{
@@ -940,12 +989,16 @@ void wpa_supplicant_set_state(struct wpa_supplicant *wpa_s,
sme_sched_obss_scan(wpa_s, 1);
@ -358,9 +369,8 @@ index c31421c3e..c18723384 100644
+ hostapd_reload(wpa_s, wpa_s->current_bss);
#if defined(CONFIG_FILS) && defined(IEEE8021X_EAPOL)
if (!fils_hlp_sent && ssid && ssid->eap.erp)
update_fils_connect_params = true;
@@ -1026,6 +1076,8 @@ void wpa_supplicant_set_state(struct wpa_supplicant *wpa_s,
#endif /* CONFIG_OWE */
wpas_update_fils_connect_params(wpa_s);
#endif /* CONFIG_FILS && IEEE8021X_EAPOL */
} else if (state == WPA_DISCONNECTED || state == WPA_ASSOCIATING ||
state == WPA_ASSOCIATED) {
+ if (wpa_s->hostapd)
@ -368,16 +378,16 @@ index c31421c3e..c18723384 100644
wpa_s->new_connection = 1;
wpa_drv_set_operstate(wpa_s, 0);
#ifndef IEEE8021X_EAPOL
@@ -2324,6 +2376,8 @@ void wpa_supplicant_associate(struct wpa_supplicant *wpa_s,
return;
}
wpa_s->current_bss = bss;
@@ -2038,6 +2091,8 @@ void wpa_supplicant_associate(struct wpa_supplicant *wpa_s,
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");
@@ -6679,6 +6733,16 @@ static int wpa_supplicant_init_iface(struct wpa_supplicant *wpa_s,
@@ -5716,6 +5771,16 @@ static int wpa_supplicant_init_iface(struct wpa_supplicant *wpa_s,
sizeof(wpa_s->bridge_ifname));
}
@ -392,9 +402,9 @@ index c31421c3e..c18723384 100644
+ }
+
/* RSNA Supplicant Key Management - INITIALIZE */
eapol_sm_notify_portEnabled(wpa_s->eapol, false);
eapol_sm_notify_portValid(wpa_s->eapol, false);
@@ -7017,6 +7081,11 @@ static void wpa_supplicant_deinit_iface(struct wpa_supplicant *wpa_s,
eapol_sm_notify_portEnabled(wpa_s->eapol, FALSE);
eapol_sm_notify_portValid(wpa_s->eapol, FALSE);
@@ -6043,6 +6108,11 @@ static void wpa_supplicant_deinit_iface(struct wpa_supplicant *wpa_s,
if (terminate)
wpa_msg(wpa_s, MSG_INFO, WPA_EVENT_TERMINATING);
@ -403,26 +413,26 @@ index c31421c3e..c18723384 100644
+ wpa_s->hostapd = NULL;
+ }
+
wpa_supplicant_ctrl_iface_deinit(wpa_s, wpa_s->ctrl_iface);
wpa_s->ctrl_iface = NULL;
if (wpa_s->ctrl_iface) {
wpa_supplicant_ctrl_iface_deinit(wpa_s->ctrl_iface);
wpa_s->ctrl_iface = NULL;
diff --git a/wpa_supplicant/wpa_supplicant_i.h b/wpa_supplicant/wpa_supplicant_i.h
index 301d5d56a..2f121462a 100644
index 8a4bdf8cb..f89dd6059 100644
--- a/wpa_supplicant/wpa_supplicant_i.h
+++ b/wpa_supplicant/wpa_supplicant_i.h
@@ -104,6 +104,11 @@ struct wpa_interface {
*/
@@ -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
*
@@ -719,6 +724,8 @@ struct wpa_supplicant {
* If the driver interface (ifname) is included in a Linux bridge
@@ -516,6 +521,8 @@ struct wpa_supplicant {
#endif /* CONFIG_CTRL_IFACE_BINDER */
char bridge_ifname[16];

View File

@ -1,6 +1,6 @@
From e54c0492fd8d13ce2e4dd9f7f6301bbeb2afd155 Mon Sep 17 00:00:00 2001
From f890ab993069f8737125bcf24d99f441759e7b63 Mon Sep 17 00:00:00 2001
From: Patrick Walther <patrick.walther@netmodule.com>
Date: Fri, 24 Jul 2020 14:41:09 +0200
Date: Tue, 28 Jan 2020 15:14:35 +0100
---
hostapd/Makefile | 3 +++
@ -15,10 +15,10 @@ Date: Fri, 24 Jul 2020 14:41:09 +0200
9 files changed, 27 insertions(+), 5 deletions(-)
diff --git a/hostapd/Makefile b/hostapd/Makefile
index 6c34c5f88..6a125ed80 100644
index da8f9bc9b..94ffc1a66 100644
--- a/hostapd/Makefile
+++ b/hostapd/Makefile
@@ -221,6 +221,9 @@ endif
@@ -220,6 +220,9 @@ endif
ifdef CONFIG_NO_CTRL_IFACE
CFLAGS += -DCONFIG_NO_CTRL_IFACE
else
@ -29,10 +29,10 @@ index 6c34c5f88..6a125ed80 100644
CFLAGS += -DCONFIG_CTRL_IFACE_UDP
else
diff --git a/hostapd/ctrl_iface.c b/hostapd/ctrl_iface.c
index 193df6e11..9215ab739 100644
index cc4f64226..ef24ebb74 100644
--- a/hostapd/ctrl_iface.c
+++ b/hostapd/ctrl_iface.c
@@ -3250,6 +3250,7 @@ static int hostapd_ctrl_iface_receive_process(struct hostapd_data *hapd,
@@ -3020,6 +3020,7 @@ static int hostapd_ctrl_iface_receive_process(struct hostapd_data *hapd,
reply_size);
} else if (os_strcmp(buf, "STATUS-DRIVER") == 0) {
reply_len = hostapd_drv_status(hapd, reply, reply_size);
@ -40,7 +40,7 @@ index 193df6e11..9215ab739 100644
} else if (os_strcmp(buf, "MIB") == 0) {
reply_len = ieee802_11_get_mib(hapd, reply, reply_size);
if (reply_len >= 0) {
@@ -3291,6 +3292,7 @@ static int hostapd_ctrl_iface_receive_process(struct hostapd_data *hapd,
@@ -3061,6 +3062,7 @@ static int hostapd_ctrl_iface_receive_process(struct hostapd_data *hapd,
} else if (os_strncmp(buf, "STA-NEXT ", 9) == 0) {
reply_len = hostapd_ctrl_iface_sta_next(hapd, buf + 9, reply,
reply_size);
@ -49,18 +49,18 @@ index 193df6e11..9215ab739 100644
if (hostapd_ctrl_iface_attach(hapd, from, fromlen, NULL))
reply_len = -1;
diff --git a/src/ap/ctrl_iface_ap.c b/src/ap/ctrl_iface_ap.c
index 5150d9bbf..c496e4f4a 100644
index 1135e8151..a1000e34a 100644
--- a/src/ap/ctrl_iface_ap.c
+++ b/src/ap/ctrl_iface_ap.c
@@ -26,6 +26,7 @@
@@ -25,6 +25,7 @@
#include "mbo_ap.h"
#include "taxonomy.h"
#include "wnm_ap.h"
+#ifdef CONFIG_CTRL_IFACE_MIB
static size_t hostapd_write_ht_mcs_bitmask(char *buf, size_t buflen,
size_t curr_len, const u8 *mcs_set)
@@ -460,6 +461,7 @@ int hostapd_ctrl_iface_sta_next(struct hostapd_data *hapd, const char *txtaddr,
@@ -423,6 +424,7 @@ int hostapd_ctrl_iface_sta_next(struct hostapd_data *hapd, const char *txtaddr,
return hostapd_ctrl_iface_sta_mib(hapd, sta->next, buf, buflen);
}
@ -68,7 +68,7 @@ index 5150d9bbf..c496e4f4a 100644
#ifdef CONFIG_P2P_MANAGER
static int p2p_manager_disconnect(struct hostapd_data *hapd, u16 stype,
@@ -832,12 +834,12 @@ int hostapd_ctrl_iface_status(struct hostapd_data *hapd, char *buf,
@@ -763,12 +765,12 @@ int hostapd_ctrl_iface_status(struct hostapd_data *hapd, char *buf,
return len;
len += ret;
}
@ -84,10 +84,10 @@ index 5150d9bbf..c496e4f4a 100644
ret = os_snprintf(buf + len, buflen - len, "supported_rates=");
if (os_snprintf_error(buflen - len, ret))
diff --git a/src/ap/ieee802_1x.c b/src/ap/ieee802_1x.c
index d90792c78..7854de1a2 100644
index e0614710f..292cd4bc8 100644
--- a/src/ap/ieee802_1x.c
+++ b/src/ap/ieee802_1x.c
@@ -2740,6 +2740,7 @@ static const char * bool_txt(bool val)
@@ -2706,6 +2706,7 @@ static const char * bool_txt(Boolean val)
return val ? "TRUE" : "FALSE";
}
@ -95,7 +95,7 @@ index d90792c78..7854de1a2 100644
int ieee802_1x_get_mib(struct hostapd_data *hapd, char *buf, size_t buflen)
{
@@ -2926,6 +2927,7 @@ int ieee802_1x_get_mib_sta(struct hostapd_data *hapd, struct sta_info *sta,
@@ -2892,6 +2893,7 @@ int ieee802_1x_get_mib_sta(struct hostapd_data *hapd, struct sta_info *sta,
return len;
}
@ -104,10 +104,10 @@ index d90792c78..7854de1a2 100644
#ifdef CONFIG_HS20
static void ieee802_1x_wnm_notif_send(void *eloop_ctx, void *timeout_ctx)
diff --git a/src/ap/wpa_auth.c b/src/ap/wpa_auth.c
index 705517b16..6fb23947b 100644
index c56077001..cb6595f2c 100644
--- a/src/ap/wpa_auth.c
+++ b/src/ap/wpa_auth.c
@@ -4559,6 +4559,7 @@ static const char * wpa_bool_txt(int val)
@@ -4116,6 +4116,7 @@ static const char * wpa_bool_txt(int val)
return val ? "TRUE" : "FALSE";
}
@ -115,7 +115,7 @@ index 705517b16..6fb23947b 100644
#define RSN_SUITE "%02x-%02x-%02x-%d"
#define RSN_SUITE_ARG(s) \
@@ -4709,7 +4710,7 @@ int wpa_get_mib_sta(struct wpa_state_machine *sm, char *buf, size_t buflen)
@@ -4264,7 +4265,7 @@ int wpa_get_mib_sta(struct wpa_state_machine *sm, char *buf, size_t buflen)
return len;
}
@ -125,10 +125,10 @@ index 705517b16..6fb23947b 100644
void wpa_auth_countermeasures_start(struct wpa_authenticator *wpa_auth)
{
diff --git a/src/rsn_supp/wpa.c b/src/rsn_supp/wpa.c
index 577717611..27bb644be 100644
index c929e8194..39dcecd17 100644
--- a/src/rsn_supp/wpa.c
+++ b/src/rsn_supp/wpa.c
@@ -2801,6 +2801,8 @@ static u32 wpa_key_mgmt_suite(struct wpa_sm *sm)
@@ -2502,6 +2502,8 @@ static u32 wpa_key_mgmt_suite(struct wpa_sm *sm)
}
@ -137,7 +137,7 @@ index 577717611..27bb644be 100644
#define RSN_SUITE "%02x-%02x-%02x-%d"
#define RSN_SUITE_ARG(s) \
((s) >> 24) & 0xff, ((s) >> 16) & 0xff, ((s) >> 8) & 0xff, (s) & 0xff
@@ -2882,6 +2884,7 @@ int wpa_sm_get_mib(struct wpa_sm *sm, char *buf, size_t buflen)
@@ -2585,6 +2587,7 @@ int wpa_sm_get_mib(struct wpa_sm *sm, char *buf, size_t buflen)
return (int) len;
}
@ -146,10 +146,10 @@ index 577717611..27bb644be 100644
diff --git a/wpa_supplicant/Makefile b/wpa_supplicant/Makefile
index 969dc713f..57a89edcb 100644
index d8e42fe2f..3ee2d6eff 100644
--- a/wpa_supplicant/Makefile
+++ b/wpa_supplicant/Makefile
@@ -973,6 +973,9 @@ ifdef CONFIG_FILS
@@ -957,6 +957,9 @@ ifdef CONFIG_FILS
OBJS += ../src/ap/fils_hlp.o
endif
ifdef CONFIG_CTRL_IFACE
@ -160,10 +160,10 @@ index 969dc713f..57a89edcb 100644
endif
diff --git a/wpa_supplicant/ap.c b/wpa_supplicant/ap.c
index f21b8713f..992c0a056 100644
index 5af4be230..5b30c3e3d 100644
--- a/wpa_supplicant/ap.c
+++ b/wpa_supplicant/ap.c
@@ -1477,7 +1477,7 @@ int wpas_ap_wps_nfc_report_handover(struct wpa_supplicant *wpa_s,
@@ -1236,7 +1236,7 @@ int wpas_ap_wps_nfc_report_handover(struct wpa_supplicant *wpa_s,
#endif /* CONFIG_WPS */
@ -173,10 +173,10 @@ index f21b8713f..992c0a056 100644
int ap_ctrl_iface_sta_first(struct wpa_supplicant *wpa_s,
char *buf, size_t buflen)
diff --git a/wpa_supplicant/ctrl_iface.c b/wpa_supplicant/ctrl_iface.c
index 499e6d3dd..0b931a7d5 100644
index 8efc08d4d..a328b877b 100644
--- a/wpa_supplicant/ctrl_iface.c
+++ b/wpa_supplicant/ctrl_iface.c
@@ -2325,7 +2325,7 @@ static int wpa_supplicant_ctrl_iface_status(struct wpa_supplicant *wpa_s,
@@ -2144,7 +2144,7 @@ static int wpa_supplicant_ctrl_iface_status(struct wpa_supplicant *wpa_s,
pos += ret;
}
@ -185,7 +185,7 @@ index 499e6d3dd..0b931a7d5 100644
if (wpa_s->ap_iface) {
pos += ap_ctrl_iface_wpa_get_status(wpa_s, pos,
end - pos,
@@ -11521,6 +11521,7 @@ char * wpa_supplicant_ctrl_iface_process(struct wpa_supplicant *wpa_s,
@@ -9962,6 +9962,7 @@ char * wpa_supplicant_ctrl_iface_process(struct wpa_supplicant *wpa_s,
reply_len = -1;
} else if (os_strncmp(buf, "NOTE ", 5) == 0) {
wpa_printf(MSG_INFO, "NOTE: %s", buf + 5);
@ -193,7 +193,7 @@ index 499e6d3dd..0b931a7d5 100644
} else if (os_strcmp(buf, "MIB") == 0) {
reply_len = wpa_sm_get_mib(wpa_s->wpa, reply, reply_size);
if (reply_len >= 0) {
@@ -11533,6 +11534,7 @@ char * wpa_supplicant_ctrl_iface_process(struct wpa_supplicant *wpa_s,
@@ -9974,6 +9975,7 @@ char * wpa_supplicant_ctrl_iface_process(struct wpa_supplicant *wpa_s,
reply_size - reply_len);
#endif /* CONFIG_MACSEC */
}
@ -201,7 +201,7 @@ index 499e6d3dd..0b931a7d5 100644
} else if (os_strncmp(buf, "STATUS", 6) == 0) {
reply_len = wpa_supplicant_ctrl_iface_status(
wpa_s, buf + 6, reply, reply_size);
@@ -12021,6 +12023,7 @@ char * wpa_supplicant_ctrl_iface_process(struct wpa_supplicant *wpa_s,
@@ -10458,6 +10460,7 @@ char * wpa_supplicant_ctrl_iface_process(struct wpa_supplicant *wpa_s,
reply_len = wpa_supplicant_ctrl_iface_bss(
wpa_s, buf + 4, reply, reply_size);
#ifdef CONFIG_AP
@ -209,7 +209,7 @@ index 499e6d3dd..0b931a7d5 100644
} else if (os_strcmp(buf, "STA-FIRST") == 0) {
reply_len = ap_ctrl_iface_sta_first(wpa_s, reply, reply_size);
} else if (os_strncmp(buf, "STA ", 4) == 0) {
@@ -12029,12 +12032,15 @@ char * wpa_supplicant_ctrl_iface_process(struct wpa_supplicant *wpa_s,
@@ -10466,12 +10469,15 @@ char * wpa_supplicant_ctrl_iface_process(struct wpa_supplicant *wpa_s,
} else if (os_strncmp(buf, "STA-NEXT ", 9) == 0) {
reply_len = ap_ctrl_iface_sta_next(wpa_s, buf + 9, reply,
reply_size);

View File

@ -1,16 +1,16 @@
From 0111fae9ca0184e10b60494c4ecdc27f2636bc17 Mon Sep 17 00:00:00 2001
From c4df803ed65c86cd50fb462ed81d58bd57ae781e Mon Sep 17 00:00:00 2001
From: Patrick Walther <patrick.walther@netmodule.com>
Date: Fri, 24 Jul 2020 14:41:09 +0200
Date: Tue, 28 Jan 2020 15:14:35 +0100
---
hostapd/hostapd_cli.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hostapd/hostapd_cli.c b/hostapd/hostapd_cli.c
index 60396f3da..ad39aeb3b 100644
index 046024390..14d3fd9f0 100644
--- a/hostapd/hostapd_cli.c
+++ b/hostapd/hostapd_cli.c
@@ -744,7 +744,7 @@ static int wpa_ctrl_command_sta(struct wpa_ctrl *ctrl, const char *cmd,
@@ -743,7 +743,7 @@ static int wpa_ctrl_command_sta(struct wpa_ctrl *ctrl, const char *cmd,
}
buf[len] = '\0';

View File

@ -1,16 +1,16 @@
From 09a00a07a0db13618bad412c058c9d4786f2264b Mon Sep 17 00:00:00 2001
From 8dd311e8023bbceda50d21698f795f2e654bd038 Mon Sep 17 00:00:00 2001
From: Patrick Walther <patrick.walther@netmodule.com>
Date: Fri, 24 Jul 2020 14:41:09 +0200
Date: Tue, 28 Jan 2020 15:14:35 +0100
---
src/common/wpa_common.c | 40 ++++++++++++++++++++++++++++++++++++++--
1 file changed, 38 insertions(+), 2 deletions(-)
diff --git a/src/common/wpa_common.c b/src/common/wpa_common.c
index 587cd88b2..2b2b09fb9 100644
index 64e5c5f4c..da1a148b9 100644
--- a/src/common/wpa_common.c
+++ b/src/common/wpa_common.c
@@ -2451,6 +2451,31 @@ u32 wpa_akm_to_suite(int akm)
@@ -2089,6 +2089,31 @@ u32 wpa_akm_to_suite(int akm)
}
@ -42,7 +42,7 @@ index 587cd88b2..2b2b09fb9 100644
int wpa_compare_rsn_ie(int ft_initial_assoc,
const u8 *ie1, size_t ie1len,
const u8 *ie2, size_t ie2len)
@@ -2458,8 +2483,19 @@ int wpa_compare_rsn_ie(int ft_initial_assoc,
@@ -2096,8 +2121,19 @@ int wpa_compare_rsn_ie(int ft_initial_assoc,
if (ie1 == NULL || ie2 == NULL)
return -1;

View File

@ -1,33 +1,32 @@
From 1c7809b15fab60dd8781248bd53ee4760d3c3ace Mon Sep 17 00:00:00 2001
From aa9509512105dc95a3091696d7305900d701be03 Mon Sep 17 00:00:00 2001
From: Patrick Walther <patrick.walther@netmodule.com>
Date: Fri, 24 Jul 2020 14:41:09 +0200
Date: Tue, 28 Jan 2020 15:14:35 +0100
---
src/ap/wps_hostapd.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/src/ap/wps_hostapd.c b/src/ap/wps_hostapd.c
index aacfa3372..0c351af5f 100644
index 6161cdbdb..4a0302043 100644
--- a/src/ap/wps_hostapd.c
+++ b/src/ap/wps_hostapd.c
@@ -394,9 +394,8 @@ static int hapd_wps_reconfig_in_memory(struct hostapd_data *hapd,
@@ -346,8 +346,7 @@ static int hapd_wps_reconfig_in_memory(struct hostapd_data *hapd,
bss->wpa_pairwise |= WPA_CIPHER_GCMP;
else
bss->wpa_pairwise |= WPA_CIPHER_CCMP;
- }
#ifndef CONFIG_NO_TKIP
- if (cred->encr_type & WPS_ENCR_TKIP)
+ } else if (cred->encr_type & WPS_ENCR_TKIP)
bss->wpa_pairwise |= WPA_CIPHER_TKIP;
#endif /* CONFIG_NO_TKIP */
bss->rsn_pairwise = bss->wpa_pairwise;
@@ -1181,8 +1180,7 @@ int hostapd_init_wps(struct hostapd_data *hapd,
bss->wpa_group = wpa_select_ap_group_cipher(bss->wpa,
@@ -1108,8 +1107,7 @@ int hostapd_init_wps(struct hostapd_data *hapd,
WPA_CIPHER_GCMP_256)) {
wps->encr_types |= WPS_ENCR_AES;
wps->encr_types_rsn |= WPS_ENCR_AES;
- }
- if (conf->rsn_pairwise & WPA_CIPHER_TKIP) {
+ } else if (conf->rsn_pairwise & WPA_CIPHER_TKIP) {
#ifdef CONFIG_NO_TKIP
wpa_printf(MSG_INFO, "WPS: TKIP not supported");
goto fail;
wps->encr_types |= WPS_ENCR_TKIP;
wps->encr_types_rsn |= WPS_ENCR_TKIP;
}

View File

@ -1,14 +1,14 @@
From 833a09ecb52559b9dcef824ff29620d12a88f085 Mon Sep 17 00:00:00 2001
From 7b5795055ae75d37753933b2cc7b5b10185fc70a Mon Sep 17 00:00:00 2001
From: Patrick Walther <patrick.walther@netmodule.com>
Date: Fri, 24 Jul 2020 14:41:09 +0200
Date: Tue, 28 Jan 2020 15:14:35 +0100
---
src/utils/wpa_debug.c | 36 ++++------------------
src/utils/wpa_debug.h | 69 +++++++++++++++++++++++++++++++++++++------
2 files changed, 65 insertions(+), 40 deletions(-)
src/utils/wpa_debug.c | 40 ++++++-----------------------
src/utils/wpa_debug.h | 69 ++++++++++++++++++++++++++++++++++++++++++++-------
2 files changed, 67 insertions(+), 42 deletions(-)
diff --git a/src/utils/wpa_debug.c b/src/utils/wpa_debug.c
index a338a2039..a887d60b3 100644
index c336e5389..334f22d72 100644
--- a/src/utils/wpa_debug.c
+++ b/src/utils/wpa_debug.c
@@ -206,7 +206,7 @@ void wpa_debug_close_linux_tracing(void)
@ -20,37 +20,41 @@ index a338a2039..a887d60b3 100644
{
va_list ap;
@@ -255,7 +255,7 @@ void wpa_printf(int level, const char *fmt, ...)
@@ -253,8 +253,8 @@ void wpa_printf(int level, const char *fmt, ...)
}
-static void _wpa_hexdump(int level, const char *title, const u8 *buf,
- size_t len, int show)
+void _wpa_hexdump(int level, const char *title, const u8 *buf,
size_t len, int show, int only_syslog)
+ size_t len, int show)
{
size_t i;
@@ -382,19 +382,7 @@ static void _wpa_hexdump(int level, const char *title, const u8 *buf,
@@ -380,20 +380,8 @@ static void _wpa_hexdump(int level, const char *title, const u8 *buf,
#endif /* CONFIG_ANDROID_LOG */
}
-void wpa_hexdump(int level, const char *title, const void *buf, size_t len)
-{
- _wpa_hexdump(level, title, buf, len, 1, 0);
- _wpa_hexdump(level, title, buf, len, 1);
-}
-
-
-void wpa_hexdump_key(int level, const char *title, const void *buf, size_t len)
-{
- _wpa_hexdump(level, title, buf, len, wpa_debug_show_keys, 0);
- _wpa_hexdump(level, title, buf, len, wpa_debug_show_keys);
-}
-
-
-static void _wpa_hexdump_ascii(int level, const char *title, const void *buf,
- size_t len, int show)
+void _wpa_hexdump_ascii(int level, const char *title, const void *buf,
size_t len, int show)
+ size_t len, int show)
{
size_t i, llen;
@@ -507,20 +495,6 @@ file_done:
const u8 *pos = buf;
@@ -506,20 +494,6 @@ static void _wpa_hexdump_ascii(int level, const char *title, const void *buf,
}
@ -71,7 +75,7 @@ index a338a2039..a887d60b3 100644
#ifdef CONFIG_DEBUG_FILE
static char *last_path = NULL;
#endif /* CONFIG_DEBUG_FILE */
@@ -636,7 +610,7 @@ void wpa_msg_register_ifname_cb(wpa_msg_get_ifname_func func)
@@ -635,7 +609,7 @@ void wpa_msg_register_ifname_cb(wpa_msg_get_ifname_func func)
}
@ -80,7 +84,7 @@ index a338a2039..a887d60b3 100644
{
va_list ap;
char *buf;
@@ -674,7 +648,7 @@ void wpa_msg(void *ctx, int level, const char *fmt, ...)
@@ -673,7 +647,7 @@ void wpa_msg(void *ctx, int level, const char *fmt, ...)
}
@ -90,16 +94,16 @@ index a338a2039..a887d60b3 100644
va_list ap;
char *buf;
diff --git a/src/utils/wpa_debug.h b/src/utils/wpa_debug.h
index c6d5cc647..824538b41 100644
index 1fe0b7db7..8a685a164 100644
--- a/src/utils/wpa_debug.h
+++ b/src/utils/wpa_debug.h
@@ -50,6 +50,17 @@ int wpa_debug_reopen_file(void);
@@ -52,6 +52,17 @@ int wpa_debug_reopen_file(void);
void wpa_debug_close_file(void);
void wpa_debug_setup_stdout(void);
+/* internal */
+void _wpa_hexdump(int level, const char *title, const u8 *buf,
+ size_t len, int show, int only_syslog);
+ size_t len, int show);
+void _wpa_hexdump_ascii(int level, const char *title, const void *buf,
+ size_t len, int show);
+extern int wpa_debug_show_keys;
@ -111,7 +115,7 @@ index c6d5cc647..824538b41 100644
/**
* wpa_debug_printf_timestamp - Print timestamp for debug output
*
@@ -70,9 +81,15 @@ void wpa_debug_print_timestamp(void);
@@ -72,9 +83,15 @@ void wpa_debug_print_timestamp(void);
*
* Note: New line '\n' is added to the end of the text when printing to stdout.
*/
@ -128,7 +132,7 @@ index c6d5cc647..824538b41 100644
/**
* wpa_hexdump - conditional hex dump
* @level: priority level (MSG_*) of the message
@@ -84,7 +101,13 @@ PRINTF_FORMAT(2, 3);
@@ -86,7 +103,13 @@ PRINTF_FORMAT(2, 3);
* output may be directed to stdout, stderr, and/or syslog based on
* configuration. The contents of buf is printed out has hex dump.
*/
@ -138,12 +142,12 @@ index c6d5cc647..824538b41 100644
+ if (level < CONFIG_MSG_MIN_PRIORITY)
+ return;
+
+ _wpa_hexdump(level, title, buf, len, 1, 1);
+ _wpa_hexdump(level, title, buf, len, 1);
+}
static inline void wpa_hexdump_buf(int level, const char *title,
const struct wpabuf *buf)
@@ -106,7 +129,13 @@ static inline void wpa_hexdump_buf(int level, const char *title,
@@ -108,7 +131,13 @@ static inline void wpa_hexdump_buf(int level, const char *title,
* like wpa_hexdump(), but by default, does not include secret keys (passwords,
* etc.) in debug output.
*/
@ -153,12 +157,12 @@ index c6d5cc647..824538b41 100644
+ if (level < CONFIG_MSG_MIN_PRIORITY)
+ return;
+
+ _wpa_hexdump(level, title, buf, len, wpa_debug_show_keys, 1);
+ _wpa_hexdump(level, title, buf, len, wpa_debug_show_keys);
+}
static inline void wpa_hexdump_buf_key(int level, const char *title,
const struct wpabuf *buf)
@@ -128,8 +157,14 @@ static inline void wpa_hexdump_buf_key(int level, const char *title,
@@ -130,8 +159,14 @@ static inline void wpa_hexdump_buf_key(int level, const char *title,
* the hex numbers and ASCII characters (for printable range) are shown. 16
* bytes per line will be shown.
*/
@ -175,7 +179,7 @@ index c6d5cc647..824538b41 100644
/**
* wpa_hexdump_ascii_key - conditional hex dump, hide keys
@@ -145,8 +180,14 @@ void wpa_hexdump_ascii(int level, const char *title, const void *buf,
@@ -147,8 +182,14 @@ void wpa_hexdump_ascii(int level, const char *title, const void *buf,
* bytes per line will be shown. This works like wpa_hexdump_ascii(), but by
* default, does not include secret keys (passwords, etc.) in debug output.
*/
@ -192,7 +196,7 @@ index c6d5cc647..824538b41 100644
/*
* wpa_dbg() behaves like wpa_msg(), but it can be removed from build to reduce
@@ -183,7 +224,12 @@ void wpa_hexdump_ascii_key(int level, const char *title, const void *buf,
@@ -185,7 +226,12 @@ void wpa_hexdump_ascii_key(int level, const char *title, const void *buf,
*
* Note: New line '\n' is added to the end of the text when printing to stdout.
*/
@ -206,7 +210,7 @@ index c6d5cc647..824538b41 100644
/**
* wpa_msg_ctrl - Conditional printf for ctrl_iface monitors
@@ -197,8 +243,13 @@ void wpa_msg(void *ctx, int level, const char *fmt, ...) PRINTF_FORMAT(3, 4);
@@ -199,8 +245,13 @@ void wpa_msg(void *ctx, int level, const char *fmt, ...) PRINTF_FORMAT(3, 4);
* attached ctrl_iface monitors. In other words, it can be used for frequent
* events that do not need to be sent to syslog.
*/

View File

@ -1,35 +1,34 @@
From 86099ab5f18972ae8fb503c2f3eead226486cb2d Mon Sep 17 00:00:00 2001
From d2c20f1a0dd228fcfaa36bb9fdd1e38148e7b145 Mon Sep 17 00:00:00 2001
From: Patrick Walther <patrick.walther@netmodule.com>
Date: Fri, 24 Jul 2020 14:41:09 +0200
Date: Tue, 28 Jan 2020 15:14:35 +0100
---
hostapd/main.c | 6 ++++--
hostapd/main.c | 5 ++++-
wpa_supplicant/main.c | 11 ++++++++---
2 files changed, 12 insertions(+), 5 deletions(-)
2 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/hostapd/main.c b/hostapd/main.c
index 6a7b91bf2..0c972bba9 100644
index 90424d5bd..4b537f35a 100644
--- a/hostapd/main.c
+++ b/hostapd/main.c
@@ -31,7 +31,7 @@
#include "config_file.h"
#include "eap_register.h"
#include "ctrl_iface.h"
-
+#include "build_features.h"
struct hapd_global {
void **drv_priv;
@@ -692,7 +692,7 @@ int main(int argc, char *argv[])
@@ -15,6 +15,7 @@
#include "utils/common.h"
#include "utils/eloop.h"
#include "utils/uuid.h"
+#include "utils/build_features.h"
#include "crypto/random.h"
#include "crypto/tls.h"
#include "common/version.h"
@@ -690,7 +691,7 @@ int main(int argc, char *argv[])
wpa_supplicant_event = hostapd_wpa_event;
wpa_supplicant_event_global = hostapd_wpa_event_global;
for (;;) {
- c = getopt(argc, argv, "b:Bde:f:hi:KP:sSTtu:vg:G:q");
+ c = getopt(argc, argv, "b:Bde:f:hi:KP:sSTtu:g:G:qv::");
- c = getopt(argc, argv, "b:Bde:f:hi:KP:sSTtu:vg:G:");
+ c = getopt(argc, argv, "b:Bde:f:hi:KP:sSTtu:g:G:v::");
if (c < 0)
break;
switch (c) {
@@ -729,6 +729,8 @@ int main(int argc, char *argv[])
@@ -727,6 +728,8 @@ int main(int argc, char *argv[])
break;
#endif /* CONFIG_DEBUG_LINUX_TRACING */
case 'v':
@ -37,9 +36,9 @@ index 6a7b91bf2..0c972bba9 100644
+ exit(!has_feature(optarg));
show_version();
exit(1);
case 'g':
break;
diff --git a/wpa_supplicant/main.c b/wpa_supplicant/main.c
index 535923ecd..5ebda5a67 100644
index 669f5b0b6..3d7f1ba6e 100644
--- a/wpa_supplicant/main.c
+++ b/wpa_supplicant/main.c
@@ -12,6 +12,7 @@
@ -47,10 +46,10 @@ index 535923ecd..5ebda5a67 100644
#include "common.h"
+#include "build_features.h"
#include "crypto/crypto.h"
#include "fst/fst.h"
#include "wpa_supplicant_i.h"
@@ -203,7 +204,7 @@ int main(int argc, char *argv[])
#include "driver_i.h"
@@ -202,7 +203,7 @@ int main(int argc, char *argv[])
for (;;) {
c = getopt(argc, argv,
@ -59,7 +58,7 @@ index 535923ecd..5ebda5a67 100644
if (c < 0)
break;
switch (c) {
@@ -306,8 +307,12 @@ int main(int argc, char *argv[])
@@ -305,8 +306,12 @@ int main(int argc, char *argv[])
break;
#endif /* CONFIG_CTRL_IFACE_DBUS_NEW */
case 'v':

View File

@ -1,16 +1,16 @@
From cbf654d789340c578f1cd6648670f7c242c8dcfa Mon Sep 17 00:00:00 2001
From 0c14b6a7fc8ebce22da7e09d9e2761ccabcc58b8 Mon Sep 17 00:00:00 2001
From: Patrick Walther <patrick.walther@netmodule.com>
Date: Fri, 24 Jul 2020 14:41:09 +0200
Date: Tue, 28 Jan 2020 15:14:35 +0100
---
hostapd/hostapd_cli.c | 8 --------
1 file changed, 8 deletions(-)
diff --git a/hostapd/hostapd_cli.c b/hostapd/hostapd_cli.c
index ad39aeb3b..6b5387869 100644
index 14d3fd9f0..7ede2bdb7 100644
--- a/hostapd/hostapd_cli.c
+++ b/hostapd/hostapd_cli.c
@@ -388,7 +388,6 @@ static int hostapd_cli_cmd_disassociate(struct wpa_ctrl *ctrl, int argc,
@@ -385,7 +385,6 @@ static int hostapd_cli_cmd_disassociate(struct wpa_ctrl *ctrl, int argc,
}
@ -18,23 +18,23 @@ index ad39aeb3b..6b5387869 100644
static int hostapd_cli_cmd_signature(struct wpa_ctrl *ctrl, int argc,
char *argv[])
{
@@ -401,7 +400,6 @@ static int hostapd_cli_cmd_signature(struct wpa_ctrl *ctrl, int argc,
@@ -398,7 +397,6 @@ static int hostapd_cli_cmd_signature(struct wpa_ctrl *ctrl, int argc,
os_snprintf(buf, sizeof(buf), "SIGNATURE %s", argv[0]);
return wpa_ctrl_command(ctrl, buf);
}
-#endif /* CONFIG_TAXONOMY */
static int hostapd_cli_cmd_sa_query(struct wpa_ctrl *ctrl, int argc,
@@ -418,7 +416,6 @@ static int hostapd_cli_cmd_sa_query(struct wpa_ctrl *ctrl, int argc,
}
#ifdef CONFIG_IEEE80211W
@@ -417,7 +415,6 @@ static int hostapd_cli_cmd_sa_query(struct wpa_ctrl *ctrl, int argc,
#endif /* CONFIG_IEEE80211W */
-#ifdef CONFIG_WPS
static int hostapd_cli_cmd_wps_pin(struct wpa_ctrl *ctrl, int argc,
char *argv[])
{
@@ -644,7 +641,6 @@ static int hostapd_cli_cmd_wps_config(struct wpa_ctrl *ctrl, int argc,
@@ -643,7 +640,6 @@ static int hostapd_cli_cmd_wps_config(struct wpa_ctrl *ctrl, int argc,
ssid_hex, argv[1]);
return wpa_ctrl_command(ctrl, buf);
}
@ -42,7 +42,7 @@ index ad39aeb3b..6b5387869 100644
static int hostapd_cli_cmd_disassoc_imminent(struct wpa_ctrl *ctrl, int argc,
@@ -1579,13 +1575,10 @@ static const struct hostapd_cli_cmd hostapd_cli_commands[] = {
@@ -1538,15 +1534,12 @@ static const struct hostapd_cli_cmd hostapd_cli_commands[] = {
{ "disassociate", hostapd_cli_cmd_disassociate,
hostapd_complete_stations,
"<addr> = disassociate a station" },
@ -50,13 +50,15 @@ index ad39aeb3b..6b5387869 100644
{ "signature", hostapd_cli_cmd_signature, hostapd_complete_stations,
"<addr> = get taxonomy signature for a station" },
-#endif /* CONFIG_TAXONOMY */
#ifdef CONFIG_IEEE80211W
{ "sa_query", hostapd_cli_cmd_sa_query, hostapd_complete_stations,
"<addr> = send SA Query to a station" },
#endif /* CONFIG_IEEE80211W */
-#ifdef CONFIG_WPS
{ "wps_pin", hostapd_cli_cmd_wps_pin, NULL,
"<uuid> <pin> [timeout] [addr] = add WPS Enrollee PIN" },
{ "wps_check_pin", hostapd_cli_cmd_wps_check_pin, NULL,
@@ -1610,7 +1603,6 @@ static const struct hostapd_cli_cmd hostapd_cli_commands[] = {
@@ -1571,7 +1564,6 @@ static const struct hostapd_cli_cmd hostapd_cli_commands[] = {
"<SSID> <auth> <encr> <key> = configure AP" },
{ "wps_get_status", hostapd_cli_cmd_wps_get_status, NULL,
"= show current WPS status" },

View File

@ -1,13 +1,13 @@
From ee90e69b78884550b098dff70cd9df02834d6a21 Mon Sep 17 00:00:00 2001
From 263d0dc826ac847d2bea23d0c13ebf7ffdf81e87 Mon Sep 17 00:00:00 2001
From: Patrick Walther <patrick.walther@netmodule.com>
Date: Fri, 24 Jul 2020 14:41:09 +0200
Date: Tue, 28 Jan 2020 15:14:35 +0100
---
wpa_supplicant/wpa_cli.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/wpa_supplicant/wpa_cli.c b/wpa_supplicant/wpa_cli.c
index 0e2315d25..91e07427f 100644
index 43ac42720..5e134b0e0 100644
--- a/wpa_supplicant/wpa_cli.c
+++ b/wpa_supplicant/wpa_cli.c
@@ -26,6 +26,15 @@

View File

@ -1,6 +1,6 @@
From 5c6d5f192b60fc0dd14085af9e4e530dbc7f359d Mon Sep 17 00:00:00 2001
From 17a3b7768255699d9fe7d3099d0ed83dc8dc9089 Mon Sep 17 00:00:00 2001
From: Patrick Walther <patrick.walther@netmodule.com>
Date: Fri, 24 Jul 2020 14:41:09 +0200
Date: Tue, 28 Jan 2020 15:14:35 +0100
---
src/drivers/linux_wext.h | 1 +

View File

@ -1,13 +1,13 @@
From 45669a452a963ac83bb788d66879f58e6feb894e Mon Sep 17 00:00:00 2001
From d32de242fcf209a7de6aa4cd29fcf8f838e0c520 Mon Sep 17 00:00:00 2001
From: Patrick Walther <patrick.walther@netmodule.com>
Date: Fri, 24 Jul 2020 14:41:09 +0200
Date: Tue, 28 Jan 2020 15:14:35 +0100
---
hostapd/main.c | 29 +++++++++++++----------------
1 file changed, 13 insertions(+), 16 deletions(-)
diff --git a/hostapd/main.c b/hostapd/main.c
index 0c972bba9..859ff3046 100644
index 4b537f35a..f9b29aa88 100644
--- a/hostapd/main.c
+++ b/hostapd/main.c
@@ -39,6 +39,8 @@ struct hapd_global {
@ -19,7 +19,7 @@ index 0c972bba9..859ff3046 100644
#ifndef CONFIG_NO_HOSTAPD_LOGGER
@@ -146,6 +148,14 @@ static void hostapd_logger_cb(void *ctx, const u8 *addr, unsigned int module,
@@ -149,6 +151,14 @@ static void hostapd_logger_cb(void *ctx, const u8 *addr, unsigned int module,
}
#endif /* CONFIG_NO_HOSTAPD_LOGGER */
@ -34,7 +34,7 @@ index 0c972bba9..859ff3046 100644
/**
* hostapd_driver_init - Preparate driver interface
@@ -164,6 +174,8 @@ static int hostapd_driver_init(struct hostapd_iface *iface)
@@ -167,6 +177,8 @@ static int hostapd_driver_init(struct hostapd_iface *iface)
return -1;
}
@ -43,7 +43,7 @@ index 0c972bba9..859ff3046 100644
/* Initialize the driver interface */
if (!(b[0] | b[1] | b[2] | b[3] | b[4] | b[5]))
b = NULL;
@@ -404,8 +416,6 @@ static void hostapd_global_deinit(const char *pid_file, int eloop_initialized)
@@ -407,8 +419,6 @@ static void hostapd_global_deinit(const char *pid_file, int eloop_initialized)
#endif /* CONFIG_NATIVE_WINDOWS */
eap_server_unregister_methods();
@ -52,7 +52,7 @@ index 0c972bba9..859ff3046 100644
}
@@ -431,18 +441,6 @@ static int hostapd_global_run(struct hapd_interfaces *ifaces, int daemonize,
@@ -434,18 +444,6 @@ static int hostapd_global_run(struct hapd_interfaces *ifaces, int daemonize,
}
#endif /* EAP_SERVER_TNC */
@ -71,7 +71,7 @@ index 0c972bba9..859ff3046 100644
eloop_run();
return 0;
@@ -645,8 +643,7 @@ int main(int argc, char *argv[])
@@ -647,8 +645,7 @@ int main(int argc, char *argv[])
struct hapd_interfaces interfaces;
int ret = 1;
size_t i, j;

View File

@ -1,4 +1,4 @@
From a25ddcc5458fce3ca367d3d24d2a6ba8e7291689 Mon Sep 17 00:00:00 2001
From 10040581346e2465c4f446c9dd006d29ff9cbd7a Mon Sep 17 00:00:00 2001
From: Antonio Quartulli <ordex@autistici.org>
Date: Sun, 3 Jun 2012 18:22:56 +0200
Subject: [PATCH] wpa_supplicant: add new config params to be used with the
@ -8,13 +8,13 @@ Signed-hostap: Antonio Quartulli <ordex@autistici.org>
---
src/drivers/driver.h | 4 ++
wpa_supplicant/config.c | 94 +++++++++++++++++++++++++++++++++
wpa_supplicant/config_ssid.h | 5 ++
wpa_supplicant/config.c | 94 +++++++++++++++++++++++++++++++++++++++++
wpa_supplicant/config_ssid.h | 5 +++
wpa_supplicant/wpa_supplicant.c | 6 +++
4 files changed, 109 insertions(+)
diff --git a/src/drivers/driver.h b/src/drivers/driver.h
index f7dfcc165..3c2a25ce8 100644
index a383af19f..e7a2d8b64 100644
--- a/src/drivers/driver.h
+++ b/src/drivers/driver.h
@@ -19,6 +19,7 @@
@ -25,7 +25,7 @@ index f7dfcc165..3c2a25ce8 100644
#include "common/defs.h"
#include "common/ieee802_11_defs.h"
#include "common/wpa_common.h"
@@ -893,6 +894,9 @@ struct wpa_driver_associate_params {
@@ -819,6 +820,9 @@ struct wpa_driver_associate_params {
* responsible for selecting with which BSS to associate. */
const u8 *bssid;
@ -36,10 +36,10 @@ index f7dfcc165..3c2a25ce8 100644
* bssid_hint - BSSID of a proposed AP
*
diff --git a/wpa_supplicant/config.c b/wpa_supplicant/config.c
index ec8301ab9..57a8dd4fb 100644
index eaabaa88d..2bb91280c 100644
--- a/wpa_supplicant/config.c
+++ b/wpa_supplicant/config.c
@@ -18,6 +18,7 @@
@@ -17,6 +17,7 @@
#include "eap_peer/eap.h"
#include "p2p/p2p.h"
#include "fst/fst.h"
@ -47,7 +47,7 @@ index ec8301ab9..57a8dd4fb 100644
#include "config.h"
@@ -2321,6 +2322,97 @@ static char * wpa_config_write_peerkey(const struct parse_data *data,
@@ -2130,6 +2131,97 @@ static char * wpa_config_write_peerkey(const struct parse_data *data,
#endif /* NO_CONFIG_WRITE */
@ -145,7 +145,7 @@ index ec8301ab9..57a8dd4fb 100644
/* Helper macros for network block parser */
#ifdef OFFSET
@@ -2605,6 +2697,8 @@ static const struct parse_data ssid_fields[] = {
@@ -2382,6 +2474,8 @@ static const struct parse_data ssid_fields[] = {
{ INT(ap_max_inactivity) },
{ INT(dtim_period) },
{ INT(beacon_int) },
@ -155,7 +155,7 @@ index ec8301ab9..57a8dd4fb 100644
{ INT_RANGE(macsec_policy, 0, 1) },
{ INT_RANGE(macsec_integ_only, 0, 1) },
diff --git a/wpa_supplicant/config_ssid.h b/wpa_supplicant/config_ssid.h
index d5c90122a..de664371c 100644
index 401c22cec..ce2aeb5bf 100644
--- a/wpa_supplicant/config_ssid.h
+++ b/wpa_supplicant/config_ssid.h
@@ -10,8 +10,10 @@
@ -169,7 +169,7 @@ index d5c90122a..de664371c 100644
#define DEFAULT_EAP_WORKAROUND ((unsigned int) -1)
@@ -846,6 +848,9 @@ struct wpa_ssid {
@@ -790,6 +792,9 @@ struct wpa_ssid {
*/
void *parent_cred;
@ -180,14 +180,14 @@ index d5c90122a..de664371c 100644
/**
* macsec_policy - Determines the policy for MACsec secure session
diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c
index c18723384..605b81179 100644
index c91a5ab10..a2d0dbcc2 100644
--- a/wpa_supplicant/wpa_supplicant.c
+++ b/wpa_supplicant/wpa_supplicant.c
@@ -3883,6 +3883,12 @@ static void wpas_start_assoc_cb(struct wpa_radio_work *work, int deinit)
@@ -3266,6 +3266,12 @@ static void wpas_start_assoc_cb(struct wpa_radio_work *work, int deinit)
params.beacon_int = ssid->beacon_int;
else
params.beacon_int = wpa_s->conf->beacon_int;
+ int i = 0;
+ i = 0;
+ while (i < WLAN_SUPP_RATES_MAX) {
+ params.rates[i] = ssid->rates[i];
+ i++;
@ -195,4 +195,4 @@ index c18723384..605b81179 100644
+ params.mcast_rate = ssid->mcast_rate;
}
if (bss && ssid->enable_edmg)
params.pairwise_suite = cipher_pairwise;

View File

@ -1,4 +1,4 @@
From 62c9667d1f53d9e7612352b497b67224063049bb Mon Sep 17 00:00:00 2001
From 6ff2943d91e4c6ed209284eb02d5d8dbe258070e Mon Sep 17 00:00:00 2001
From: Antonio Quartulli <ordex@autistici.org>
Date: Sun, 3 Jun 2012 18:42:25 +0200
Subject: [PATCH] driver_nl80211: use new parameters during ibss join
@ -10,10 +10,10 @@ Signed-hostap: Antonio Quartulli <ordex@autistici.org>
1 file changed, 32 insertions(+), 1 deletion(-)
diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
index a9ae0fbe2..17875670d 100644
index 0cdcca66f..b0c71d242 100644
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
@@ -5994,7 +5994,7 @@ static int wpa_driver_nl80211_ibss(struct wpa_driver_nl80211_data *drv,
@@ -5323,7 +5323,7 @@ static int wpa_driver_nl80211_ibss(struct wpa_driver_nl80211_data *drv,
struct wpa_driver_associate_params *params)
{
struct nl_msg *msg;
@ -22,7 +22,7 @@ index a9ae0fbe2..17875670d 100644
int count = 0;
wpa_printf(MSG_DEBUG, "nl80211: Join IBSS (ifindex=%d)", drv->ifindex);
@@ -6021,6 +6021,37 @@ retry:
@@ -5350,6 +5350,37 @@ retry:
nl80211_put_beacon_int(msg, params->beacon_int))
goto fail;

View File

@ -1,4 +1,4 @@
From e46daac3ce5e3d0d9c43f21fd895ecbab247d00e Mon Sep 17 00:00:00 2001
From ea7e69a3eece261a1a74797e340fd366006fb1d2 Mon Sep 17 00:00:00 2001
From: Sven Eckelmann <sven.eckelmann@openmesh.com>
Date: Thu, 11 May 2017 08:21:45 +0200
Subject: [PATCH] set mcast_rate in mesh mode
@ -25,22 +25,22 @@ Tested-by: Simon Wunderlich <simon.wunderlich@openmesh.com>
3 files changed, 15 insertions(+)
diff --git a/src/drivers/driver.h b/src/drivers/driver.h
index 3c2a25ce8..836c16b91 100644
index e7a2d8b64..32f093f0f 100644
--- a/src/drivers/driver.h
+++ b/src/drivers/driver.h
@@ -1660,6 +1660,7 @@ struct wpa_driver_mesh_join_params {
@@ -1484,6 +1484,7 @@ struct wpa_driver_mesh_join_params {
#define WPA_DRIVER_MESH_FLAG_AMPE 0x00000008
unsigned int flags;
bool handle_dfs;
u8 handle_dfs;
+ int mcast_rate;
};
struct wpa_driver_set_key_params {
/**
diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
index 17875670d..69afdabbc 100644
index b0c71d242..9b28a398e 100644
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
@@ -10611,6 +10611,18 @@ static int nl80211_put_mesh_id(struct nl_msg *msg, const u8 *mesh_id,
@@ -9612,6 +9612,18 @@ static int nl80211_put_mesh_id(struct nl_msg *msg, const u8 *mesh_id,
}
@ -59,7 +59,7 @@ index 17875670d..69afdabbc 100644
static int nl80211_put_mesh_config(struct nl_msg *msg,
struct wpa_driver_mesh_bss_params *params)
{
@@ -10672,6 +10684,7 @@ static int nl80211_join_mesh(struct i802_bss *bss,
@@ -9673,6 +9685,7 @@ static int nl80211_join_mesh(struct i802_bss *bss,
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) ||
@ -68,10 +68,10 @@ index 17875670d..69afdabbc 100644
goto fail;
diff --git a/wpa_supplicant/mesh.c b/wpa_supplicant/mesh.c
index ad067da67..2cbe8e366 100644
index 6f54ff764..8b98f040c 100644
--- a/wpa_supplicant/mesh.c
+++ b/wpa_supplicant/mesh.c
@@ -632,6 +632,7 @@ int wpa_supplicant_join_mesh(struct wpa_supplicant *wpa_s,
@@ -494,6 +494,7 @@ int wpa_supplicant_join_mesh(struct wpa_supplicant *wpa_s,
params->meshid = ssid->ssid;
params->meshid_len = ssid->ssid_len;

View File

@ -1,16 +1,16 @@
From a6e07dbd4c1958c76cb12211a8787c709a2b0f74 Mon Sep 17 00:00:00 2001
From 090886c1b5dab18114042b8e40bfdb95c3ec1bb6 Mon Sep 17 00:00:00 2001
From: Patrick Walther <patrick.walther@netmodule.com>
Date: Fri, 24 Jul 2020 14:41:09 +0200
Date: Tue, 28 Jan 2020 15:14:35 +0100
---
wpa_supplicant/wpa_supplicant.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c
index 605b81179..4519cad0e 100644
index a2d0dbcc2..09313bc94 100644
--- a/wpa_supplicant/wpa_supplicant.c
+++ b/wpa_supplicant/wpa_supplicant.c
@@ -2528,11 +2528,13 @@ void ibss_mesh_setup_freq(struct wpa_supplicant *wpa_s,
@@ -2216,11 +2216,13 @@ void ibss_mesh_setup_freq(struct wpa_supplicant *wpa_s,
for (j = 0; j < wpa_s->last_scan_res_used; j++) {
struct wpa_bss *bss = wpa_s->last_scan_res[j];

View File

@ -1,27 +0,0 @@
From 73289165d2871182af4ca7f95a099b53bef8e459 Mon Sep 17 00:00:00 2001
From: David Bauer <mail@david-bauer.net>
Date: Sat, 14 May 2022 21:41:03 +0200
Subject: [PATCH] hostapd: config: support random BSS color
Configure the HE BSS color to a random value in case the config defines
a BSS color which exceeds the max BSS color (63).
Signed-off-by: David Bauer <mail@david-bauer.net>
---
hostapd/config_file.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/hostapd/config_file.c b/hostapd/config_file.c
index 03b902076..bc988d0dd 100644
--- a/hostapd/config_file.c
+++ b/hostapd/config_file.c
@@ -3485,6 +3485,8 @@ static int hostapd_config_fill(struct hostapd_config *conf,
} else if (os_strcmp(buf, "he_bss_color") == 0) {
conf->he_op.he_bss_color = atoi(pos) & 0x3f;
conf->he_op.he_bss_color_disabled = 0;
+ if (atoi(pos) > 63)
+ conf->he_op.he_bss_color = os_random() % 63 + 1;
} else if (os_strcmp(buf, "he_bss_color_partial") == 0) {
conf->he_op.he_bss_color_partial = atoi(pos);
} else if (os_strcmp(buf, "he_default_pe_duration") == 0) {

View File

@ -1,16 +1,36 @@
From 78ec7a84dd829e4dbc0bfd2d9c82d7c1a06467ef Mon Sep 17 00:00:00 2001
From d0f0639468a04677e537a0bba481cebb46fc419c Mon Sep 17 00:00:00 2001
From: Patrick Walther <patrick.walther@netmodule.com>
Date: Fri, 24 Jul 2020 14:41:09 +0200
Date: Tue, 28 Jan 2020 15:14:35 +0100
---
src/ap/acs.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
src/ap/acs.c | 13 +++----------
1 file changed, 3 insertions(+), 10 deletions(-)
diff --git a/src/ap/acs.c b/src/ap/acs.c
index faaedbfdb..a24e5410c 100644
index 11178a1f0..05b280459 100644
--- a/src/ap/acs.c
+++ b/src/ap/acs.c
@@ -420,20 +420,19 @@ static int acs_usable_bw160_chan(const struct hostapd_channel_data *chan)
@@ -293,18 +293,12 @@ static void acs_fail(struct hostapd_iface *iface)
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;
@@ -406,20 +400,19 @@ static int acs_usable_vht160_chan(const struct hostapd_channel_data *chan)
static int acs_survey_is_sufficient(struct freq_survey *survey)
{
if (!(survey->filled & SURVEY_HAS_NF)) {

View File

@ -1,6 +1,6 @@
From 7220bb0ffbb1b6ed518f7b258e454bbd5b6fb75a Mon Sep 17 00:00:00 2001
From 860424f37dbbb730f6f086ec3bfe0245b335be47 Mon Sep 17 00:00:00 2001
From: Patrick Walther <patrick.walther@netmodule.com>
Date: Fri, 24 Jul 2020 14:41:09 +0200
Date: Tue, 28 Jan 2020 15:14:35 +0100
---
hostapd/Makefile | 4 ++--
@ -8,21 +8,20 @@ Date: Fri, 24 Jul 2020 14:41:09 +0200
2 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/hostapd/Makefile b/hostapd/Makefile
index 6a125ed80..19a88e0fd 100644
index 94ffc1a66..637af7e4b 100644
--- a/hostapd/Makefile
+++ b/hostapd/Makefile
@@ -1307,7 +1307,7 @@ hostapd_multi.a: $(BCHECK) $(OBJS)
@@ -1332,14 +1332,14 @@ hostapd_multi.a: $(BCHECK) $(OBJS)
@$(AR) cr $@ hostapd_multi.o $(OBJS)
hostapd: $(OBJS)
hostapd: $(BCHECK) $(OBJS)
- $(Q)$(CC) $(LDFLAGS) -o hostapd $(OBJS) $(LIBS)
+ +$(Q)$(CC) $(LDFLAGS) -o hostapd $(OBJS) $(LIBS)
@$(E) " LD " $@
ifdef CONFIG_WPA_TRACE
@@ -1318,7 +1318,7 @@ _OBJS_VAR := OBJS_c
include ../src/objs.mk
OBJS_c += ../src/utils/trace.o
endif
hostapd_cli: $(OBJS_c)
- $(Q)$(CC) $(LDFLAGS) -o hostapd_cli $(OBJS_c) $(LIBS_c)
+ +$(Q)$(CC) $(LDFLAGS) -o hostapd_cli $(OBJS_c) $(LIBS_c)
@ -30,10 +29,10 @@ index 6a125ed80..19a88e0fd 100644
NOBJS = nt_password_hash.o ../src/crypto/ms_funcs.o $(SHA1OBJS)
diff --git a/wpa_supplicant/Makefile b/wpa_supplicant/Makefile
index 57a89edcb..10f6da71c 100644
index 3ee2d6eff..c4a66a0ad 100644
--- a/wpa_supplicant/Makefile
+++ b/wpa_supplicant/Makefile
@@ -1949,31 +1949,31 @@ wpa_supplicant_multi.a: .config $(BCHECK) $(OBJS) $(EXTRA_progs)
@@ -1932,23 +1932,23 @@ wpa_supplicant_multi.a: .config $(BCHECK) $(OBJS) $(EXTRA_progs)
@$(AR) cr $@ wpa_supplicant_multi.o $(OBJS)
wpa_supplicant: $(BCHECK) $(OBJS) $(EXTRA_progs)
@ -41,29 +40,21 @@ index 57a89edcb..10f6da71c 100644
+ +$(Q)$(LDO) $(LDFLAGS) -o wpa_supplicant $(OBJS) $(LIBS) $(EXTRALIBS)
@$(E) " LD " $@
_OBJS_VAR := OBJS_t
include ../src/objs.mk
eapol_test: $(OBJS_t)
- $(Q)$(LDO) $(LDFLAGS) -o eapol_test $(OBJS_t) $(LIBS)
+ +$(Q)$(LDO) $(LDFLAGS) -o eapol_test $(OBJS_t) $(LIBS)
@$(E) " LD " $@
_OBJS_VAR := OBJS_t2
include ../src/objs.mk
preauth_test: $(OBJS_t2)
- $(Q)$(LDO) $(LDFLAGS) -o preauth_test $(OBJS_t2) $(LIBS)
+ +$(Q)$(LDO) $(LDFLAGS) -o preauth_test $(OBJS_t2) $(LIBS)
@$(E) " LD " $@
_OBJS_VAR := OBJS_p
include ../src/objs.mk
wpa_passphrase: $(OBJS_p)
- $(Q)$(LDO) $(LDFLAGS) -o wpa_passphrase $(OBJS_p) $(LIBS_p) $(LIBS)
+ +$(Q)$(LDO) $(LDFLAGS) -o wpa_passphrase $(OBJS_p) $(LIBS_p) $(LIBS)
@$(E) " LD " $@
_OBJS_VAR := OBJS_c
include ../src/objs.mk
wpa_cli: $(OBJS_c)
- $(Q)$(LDO) $(LDFLAGS) -o wpa_cli $(OBJS_c) $(LIBS_c)
+ +$(Q)$(LDO) $(LDFLAGS) -o wpa_cli $(OBJS_c) $(LIBS_c)

View File

@ -1,108 +0,0 @@
From 4725c6a64dee96e3d3b7d906dfc9679d3f4a3190 Mon Sep 17 00:00:00 2001
From: OpenEmbedded <oe.patch@oe>
Date: Thu, 15 Sep 2022 12:35:28 +0000
---
src/ap/hostapd.h | 18 ++++++++++++++++++
src/ap/rrm.c | 2 ++
src/ap/wnm_ap.c | 6 ++++++
3 files changed, 26 insertions(+)
diff --git a/src/ap/hostapd.h b/src/ap/hostapd.h
index cbe03a060..5d867f086 100644
--- a/src/ap/hostapd.h
+++ b/src/ap/hostapd.h
@@ -150,6 +150,21 @@ struct hostapd_sae_commit_queue {
u8 msg[];
};
+/**
+ * struct hostapd_openwrt_stats - OpenWrt custom STA/AP statistics
+ */
+struct hostapd_openwrt_stats {
+ struct {
+ u64 neighbor_report_tx;
+ } rrm;
+
+ struct {
+ u64 bss_transition_query_rx;
+ u64 bss_transition_request_tx;
+ u64 bss_transition_response_rx;
+ } wnm;
+};
+
/**
* struct hostapd_data - hostapd per-BSS data structure
*/
@@ -164,6 +179,9 @@ struct hostapd_data {
u8 own_addr[ETH_ALEN];
+ /* OpenWrt specific statistics */
+ struct hostapd_openwrt_stats openwrt_stats;
+
int num_sta; /* number of entries in sta_list */
struct sta_info *sta_list; /* STA info list head */
#define STA_HASH_SIZE 256
diff --git a/src/ap/rrm.c b/src/ap/rrm.c
index f2d5cd16e..1aa9aa89f 100644
--- a/src/ap/rrm.c
+++ b/src/ap/rrm.c
@@ -269,6 +269,8 @@ static void hostapd_send_nei_report_resp(struct hostapd_data *hapd,
}
}
+ hapd->openwrt_stats.rrm.neighbor_report_tx++;
+
hostapd_drv_send_action(hapd, hapd->iface->freq, 0, addr,
wpabuf_head(buf), wpabuf_len(buf));
wpabuf_free(buf);
diff --git a/src/ap/wnm_ap.c b/src/ap/wnm_ap.c
index 23a352c9b..fde743acc 100644
--- a/src/ap/wnm_ap.c
+++ b/src/ap/wnm_ap.c
@@ -386,6 +386,7 @@ static int ieee802_11_send_bss_trans_mgmt_request(struct hostapd_data *hapd,
mgmt->u.action.u.bss_tm_req.validity_interval = 1;
pos = mgmt->u.action.u.bss_tm_req.variable;
+ hapd->openwrt_stats.wnm.bss_transition_request_tx++;
wpa_printf(MSG_DEBUG, "WNM: Send BSS Transition Management Request to "
MACSTR " dialog_token=%u req_mode=0x%x disassoc_timer=%u "
"validity_interval=%u",
@@ -659,10 +660,12 @@ int ieee802_11_rx_wnm_action_ap(struct hostapd_data *hapd,
switch (action) {
case WNM_BSS_TRANS_MGMT_QUERY:
+ hapd->openwrt_stats.wnm.bss_transition_query_rx++;
ieee802_11_rx_bss_trans_mgmt_query(hapd, mgmt->sa, payload,
plen);
return 0;
case WNM_BSS_TRANS_MGMT_RESP:
+ hapd->openwrt_stats.wnm.bss_transition_response_rx++;
ieee802_11_rx_bss_trans_mgmt_resp(hapd, mgmt->sa, payload,
plen);
return 0;
@@ -709,6 +712,7 @@ int wnm_send_disassoc_imminent(struct hostapd_data *hapd,
pos = mgmt->u.action.u.bss_tm_req.variable;
+ hapd->openwrt_stats.wnm.bss_transition_request_tx++;
wpa_printf(MSG_DEBUG, "WNM: Send BSS Transition Management Request frame to indicate imminent disassociation (disassoc_timer=%d) to "
MACSTR, disassoc_timer, MAC2STR(sta->addr));
if (hostapd_drv_send_mlme(hapd, buf, pos - buf, 0, NULL, 0, 0) < 0) {
@@ -790,6 +794,7 @@ int wnm_send_ess_disassoc_imminent(struct hostapd_data *hapd,
return -1;
}
+ hapd->openwrt_stats.wnm.bss_transition_request_tx++;
if (disassoc_timer) {
/* send disassociation frame after time-out */
set_disassoc_timer(hapd, sta, disassoc_timer);
@@ -870,6 +875,7 @@ int wnm_send_bss_tm_req(struct hostapd_data *hapd, struct sta_info *sta,
}
os_free(buf);
+ hapd->openwrt_stats.wnm.bss_transition_request_tx++;
if (disassoc_timer) {
/* send disassociation frame after time-out */
set_disassoc_timer(hapd, sta, disassoc_timer);

View File

@ -1,13 +1,13 @@
From 8b94367a604589d061f40f7e22b38bf59e702c9c Mon Sep 17 00:00:00 2001
From: Patrick Walther <patrick.walther@netmodule.com>
Date: Fri, 24 Jul 2020 14:41:09 +0200
From 12642c366d7043664153440940e2ed649150342f Mon Sep 17 00:00:00 2001
From: OpenEmbedded <oe.patch@oe>
Date: Thu, 14 May 2020 19:48:53 +0000
---
wpa_supplicant/wps_supplicant.h | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/wpa_supplicant/wps_supplicant.h b/wpa_supplicant/wps_supplicant.h
index c55936cee..52fb13bc1 100644
index 0fbc85174..b7affc103 100644
--- a/wpa_supplicant/wps_supplicant.h
+++ b/wpa_supplicant/wps_supplicant.h
@@ -9,6 +9,7 @@

View File

@ -1,43 +0,0 @@
From a1d6be648f6aa12d34bc4cfe8fb1c40ce4d1d427 Mon Sep 17 00:00:00 2001
From: OpenEmbedded <oe.patch@oe>
Date: Thu, 15 Sep 2022 12:35:28 +0000
---
src/common/wpa_ctrl.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/src/common/wpa_ctrl.c b/src/common/wpa_ctrl.c
index 7e197f094..791fdbf93 100644
--- a/src/common/wpa_ctrl.c
+++ b/src/common/wpa_ctrl.c
@@ -135,7 +135,7 @@ try_again:
return NULL;
}
tries++;
-#ifdef ANDROID
+
/* Set client socket file permissions so that bind() creates the client
* socket with these permissions and there is no need to try to change
* them with chmod() after bind() which would have potential issues with
@@ -147,7 +147,7 @@ try_again:
* operations to allow the response to go through. Those are using the
* no-deference-symlinks version to avoid races. */
fchmod(ctrl->s, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP);
-#endif /* ANDROID */
+
if (bind(ctrl->s, (struct sockaddr *) &ctrl->local,
sizeof(ctrl->local)) < 0) {
if (errno == EADDRINUSE && tries < 2) {
@@ -165,7 +165,11 @@ try_again:
return NULL;
}
-#ifdef ANDROID
+#ifndef ANDROID
+ /* Set group even if we do not have privileges to change owner */
+ lchown(ctrl->local.sun_path, -1, 101);
+ lchown(ctrl->local.sun_path, 101, 101);
+#else
/* Set group even if we do not have privileges to change owner */
lchown(ctrl->local.sun_path, -1, AID_WIFI);
lchown(ctrl->local.sun_path, AID_SYSTEM, AID_WIFI);

View File

@ -1,8 +1,24 @@
From 8e5a25f2c0bdda989ac910a209b13b583d84e7a4 Mon Sep 17 00:00:00 2001
From: OpenEmbedded <oe.patch@oe>
Date: Thu, 14 May 2020 19:48:53 +0000
---
hostapd/config_file.c | 4 ++++
hostapd/ctrl_iface.c | 2 +-
hostapd/main.c | 2 +-
src/ap/ap_config.c | 2 ++
src/ap/ap_config.h | 2 ++
src/ap/hostapd.c | 39 ++++++++++++++++++++++++++++++++++++---
src/ap/hostapd.h | 5 +++--
src/ap/wps_hostapd.c | 2 +-
src/drivers/driver_nl80211.c | 3 +++
9 files changed, 53 insertions(+), 8 deletions(-)
diff --git a/hostapd/config_file.c b/hostapd/config_file.c
index bc988d0dd..67b385ded 100644
index 625104831..7ca790402 100644
--- a/hostapd/config_file.c
+++ b/hostapd/config_file.c
@@ -2412,6 +2412,8 @@ static int hostapd_config_fill(struct hostapd_config *conf,
@@ -2470,6 +2470,8 @@ static int hostapd_config_fill(struct hostapd_config *conf,
bss->isolate = atoi(pos);
} else if (os_strcmp(buf, "ap_max_inactivity") == 0) {
bss->ap_max_inactivity = atoi(pos);
@ -11,20 +27,20 @@ index bc988d0dd..67b385ded 100644
} else if (os_strcmp(buf, "skip_inactivity_poll") == 0) {
bss->skip_inactivity_poll = atoi(pos);
} else if (os_strcmp(buf, "country_code") == 0) {
@@ -3117,6 +3119,8 @@ static int hostapd_config_fill(struct hostapd_config *conf,
@@ -3131,6 +3133,8 @@ static int hostapd_config_fill(struct hostapd_config *conf,
}
} else if (os_strcmp(buf, "acs_exclude_dfs") == 0) {
conf->acs_exclude_dfs = atoi(pos);
+ } else if (os_strcmp(buf, "radio_config_id") == 0) {
+ conf->config_id = os_strdup(pos);
} else if (os_strcmp(buf, "op_class") == 0) {
conf->op_class = atoi(pos);
} else if (os_strcmp(buf, "channel") == 0) {
if (os_strcmp(pos, "acs_survey") == 0) {
#ifndef CONFIG_ACS
diff --git a/hostapd/ctrl_iface.c b/hostapd/ctrl_iface.c
index 9215ab739..47183687f 100644
index ef24ebb74..880dec290 100644
--- a/hostapd/ctrl_iface.c
+++ b/hostapd/ctrl_iface.c
@@ -186,7 +186,7 @@ static int hostapd_ctrl_iface_update(struct hostapd_data *hapd, char *txt)
@@ -182,7 +182,7 @@ static int hostapd_ctrl_iface_update(struct hostapd_data *hapd, char *txt)
iface->interfaces->config_read_cb = hostapd_ctrl_iface_config_read;
reload_opts = txt;
@ -34,10 +50,10 @@ index 9215ab739..47183687f 100644
iface->interfaces->config_read_cb = config_read_cb;
}
diff --git a/hostapd/main.c b/hostapd/main.c
index 859ff3046..0d0e92e9e 100644
index f9b29aa88..6295cd258 100644
--- a/hostapd/main.c
+++ b/hostapd/main.c
@@ -317,7 +317,7 @@ static void handle_term(int sig, void *signal_ctx)
@@ -320,7 +320,7 @@ static void handle_term(int sig, void *signal_ctx)
static int handle_reload_iface(struct hostapd_iface *iface, void *ctx)
{
@ -47,10 +63,10 @@ index 859ff3046..0d0e92e9e 100644
"file - continuing with old.");
}
diff --git a/src/ap/ap_config.c b/src/ap/ap_config.c
index 1c229c6c7..23b67e139 100644
index 90348e1dd..d732095be 100644
--- a/src/ap/ap_config.c
+++ b/src/ap/ap_config.c
@@ -795,6 +795,7 @@ void hostapd_config_free_bss(struct hostapd_bss_config *conf)
@@ -698,6 +698,7 @@ void hostapd_config_free_bss(struct hostapd_bss_config *conf)
os_free(conf->radius_req_attr_sqlite);
os_free(conf->rsn_preauth_interfaces);
os_free(conf->ctrl_interface);
@ -58,7 +74,7 @@ index 1c229c6c7..23b67e139 100644
os_free(conf->ca_cert);
os_free(conf->server_cert);
os_free(conf->server_cert2);
@@ -992,6 +993,7 @@ void hostapd_config_free(struct hostapd_config *conf)
@@ -881,6 +882,7 @@ void hostapd_config_free(struct hostapd_config *conf)
for (i = 0; i < conf->num_bss; i++)
hostapd_config_free_bss(conf->bss[i]);
@ -67,31 +83,30 @@ index 1c229c6c7..23b67e139 100644
os_free(conf->supported_rates);
os_free(conf->basic_rates);
diff --git a/src/ap/ap_config.h b/src/ap/ap_config.h
index 58dd2cfed..e4340952e 100644
index 826030666..f27c51e80 100644
--- a/src/ap/ap_config.h
+++ b/src/ap/ap_config.h
@@ -285,6 +285,8 @@ struct hostapd_bss_config {
char vlan_bridge[IFNAMSIZ + 1];
char wds_bridge[IFNAMSIZ + 1];
@@ -829,6 +829,7 @@ struct hostapd_bss_config {
*/
u8 mka_psk_set;
#endif /* CONFIG_MACSEC */
+ char *config_id;
+
enum hostapd_logger_level logger_syslog_level, logger_stdout_level;
};
unsigned int logger_syslog; /* module bitfield */
@@ -966,6 +968,7 @@ struct eht_phy_capabilities_info {
struct hostapd_config {
struct hostapd_bss_config **bss, *last_bss;
size_t num_bss;
/**
@@ -1012,6 +1013,7 @@ struct hostapd_config {
unsigned int airtime_update_interval;
#define AIRTIME_MODE_MAX (__AIRTIME_MODE_MAX - 1)
#endif /* CONFIG_AIRTIME_POLICY */
+ char *config_id;
};
u16 beacon_int;
int rts_threshold;
diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c
index f6c9c0e78..5d3a6de42 100644
index 9227a1f01..847f7058b 100644
--- a/src/ap/hostapd.c
+++ b/src/ap/hostapd.c
@@ -224,6 +224,10 @@ static int hostapd_iface_conf_changed(struct hostapd_config *newconf,
@@ -206,6 +206,10 @@ static int hostapd_iface_conf_changed(struct hostapd_config *newconf,
{
size_t i;
@ -102,7 +117,7 @@ index f6c9c0e78..5d3a6de42 100644
if (newconf->num_bss != oldconf->num_bss)
return 1;
@@ -237,7 +241,7 @@ static int hostapd_iface_conf_changed(struct hostapd_config *newconf,
@@ -219,7 +223,7 @@ static int hostapd_iface_conf_changed(struct hostapd_config *newconf,
}
@ -111,7 +126,7 @@ index f6c9c0e78..5d3a6de42 100644
{
struct hapd_interfaces *interfaces = iface->interfaces;
struct hostapd_data *hapd = iface->bss[0];
@@ -260,13 +264,15 @@ int hostapd_reload_config(struct hostapd_iface *iface)
@@ -242,13 +246,16 @@ int hostapd_reload_config(struct hostapd_iface *iface)
if (newconf == NULL)
return -1;
@ -124,12 +139,13 @@ index f6c9c0e78..5d3a6de42 100644
+ if (reconf)
+ return -1;
+
+ hostapd_clear_old(iface);
+
wpa_printf(MSG_DEBUG,
"Configuration changes include interface/BSS modification - force full disable+enable sequence");
fname = os_strdup(iface->config_fname);
@@ -291,6 +297,24 @@ int hostapd_reload_config(struct hostapd_iface *iface)
@@ -273,6 +280,22 @@ int hostapd_reload_config(struct hostapd_iface *iface)
wpa_printf(MSG_ERROR,
"Failed to enable interface on config reload");
return res;
@ -138,23 +154,21 @@ index f6c9c0e78..5d3a6de42 100644
+ hapd = iface->bss[j];
+ if (!hapd->config_id || strcmp(hapd->config_id, newconf->bss[j]->config_id)) {
+ hostapd_flush_old_stations(iface->bss[j],
+ WLAN_REASON_PREV_AUTH_NOT_VALID);
+#ifdef CONFIG_WEP
+ WLAN_REASON_PREV_AUTH_NOT_VALID);
+ hostapd_broadcast_wep_clear(iface->bss[j]);
+#endif
+
+#ifndef CONFIG_NO_RADIUS
+ /* TODO: update dynamic data based on changed configuration
+ * items (e.g., open/close sockets, etc.) */
+ * items (e.g., open/close sockets, etc.) */
+ radius_client_flush(iface->bss[j]->radius, 0);
+#endif /* CONFIG_NO_RADIUS */
+ wpa_printf(MSG_INFO, "bss %zu changed", j);
+ wpa_printf(MSG_INFO, "bss %d changed", j);
+ }
+ }
}
iface->conf = newconf;
@@ -307,6 +331,12 @@ int hostapd_reload_config(struct hostapd_iface *iface)
@@ -289,6 +312,12 @@ int hostapd_reload_config(struct hostapd_iface *iface)
for (j = 0; j < iface->num_bss; j++) {
hapd = iface->bss[j];
@ -167,7 +181,7 @@ index f6c9c0e78..5d3a6de42 100644
hapd->iconf = newconf;
hapd->conf = newconf->bss[j];
hostapd_reload_bss(hapd);
@@ -2415,6 +2445,10 @@ hostapd_alloc_bss_data(struct hostapd_iface *hapd_iface,
@@ -2252,6 +2281,10 @@ hostapd_alloc_bss_data(struct hostapd_iface *hapd_iface,
hapd->iconf = conf;
hapd->conf = bss;
hapd->iface = hapd_iface;
@ -179,10 +193,10 @@ index f6c9c0e78..5d3a6de42 100644
hapd->driver = conf->driver;
hapd->ctrl_sock = -1;
diff --git a/src/ap/hostapd.h b/src/ap/hostapd.h
index 5d867f086..ae8d305aa 100644
index 518c7f10b..7cbd5fd46 100644
--- a/src/ap/hostapd.h
+++ b/src/ap/hostapd.h
@@ -46,7 +46,7 @@ struct mesh_conf;
@@ -41,7 +41,7 @@ struct mesh_conf;
struct hostapd_iface;
struct hapd_interfaces {
@ -191,7 +205,7 @@ index 5d867f086..ae8d305aa 100644
struct hostapd_config * (*config_read_cb)(const char *config_fname);
int (*ctrl_iface_init)(struct hostapd_data *hapd);
void (*ctrl_iface_deinit)(struct hostapd_data *hapd);
@@ -172,6 +172,7 @@ struct hostapd_data {
@@ -145,6 +145,7 @@ struct hostapd_data {
struct hostapd_iface *iface;
struct hostapd_config *iconf;
struct hostapd_bss_config *conf;
@ -199,7 +213,7 @@ index 5d867f086..ae8d305aa 100644
int interface_added; /* virtual interface added for this BSS */
unsigned int started:1;
unsigned int disabled:1;
@@ -652,7 +653,7 @@ struct hostapd_iface {
@@ -572,7 +573,7 @@ struct hostapd_iface {
int hostapd_for_each_interface(struct hapd_interfaces *interfaces,
int (*cb)(struct hostapd_iface *iface,
void *ctx), void *ctx);
@ -209,10 +223,10 @@ index 5d867f086..ae8d305aa 100644
struct hostapd_data *
hostapd_alloc_bss_data(struct hostapd_iface *hapd_iface,
diff --git a/src/ap/wps_hostapd.c b/src/ap/wps_hostapd.c
index 0c351af5f..e4f303bdc 100644
index 4a0302043..2c0038c1a 100644
--- a/src/ap/wps_hostapd.c
+++ b/src/ap/wps_hostapd.c
@@ -315,7 +315,7 @@ static void wps_reload_config(void *eloop_data, void *user_ctx)
@@ -275,7 +275,7 @@ static void wps_reload_config(void *eloop_data, void *user_ctx)
wpa_printf(MSG_DEBUG, "WPS: Reload configuration data");
if (iface->interfaces == NULL ||
@ -222,10 +236,10 @@ index 0c351af5f..e4f303bdc 100644
"configuration");
}
diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
index 69afdabbc..a0019c3e3 100644
index 9b28a398e..bef4ed32d 100644
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
@@ -4844,6 +4844,9 @@ static int wpa_driver_nl80211_set_ap(void *priv,
@@ -4295,6 +4295,9 @@ static int wpa_driver_nl80211_set_ap(void *priv,
if (ret) {
wpa_printf(MSG_DEBUG, "nl80211: Beacon set failed: %d (%s)",
ret, strerror(-ret));

View File

@ -1,57 +0,0 @@
From d8aa8cfd9e47a553bd8f20b8fa20eed153d76704 Mon Sep 17 00:00:00 2001
From: OpenEmbedded <oe.patch@oe>
Date: Thu, 15 Sep 2022 12:35:28 +0000
---
hostapd/config_file.c | 2 ++
src/ap/ap_config.h | 1 +
src/ap/vlan_full.c | 4 ++++
3 files changed, 7 insertions(+)
diff --git a/hostapd/config_file.c b/hostapd/config_file.c
index 67b385ded..7fcbb0be3 100644
--- a/hostapd/config_file.c
+++ b/hostapd/config_file.c
@@ -3342,6 +3342,8 @@ static int hostapd_config_fill(struct hostapd_config *conf,
#ifndef CONFIG_NO_VLAN
} else if (os_strcmp(buf, "dynamic_vlan") == 0) {
bss->ssid.dynamic_vlan = atoi(pos);
+ } else if (os_strcmp(buf, "vlan_no_bridge") == 0) {
+ bss->ssid.vlan_no_bridge = atoi(pos);
} else if (os_strcmp(buf, "per_sta_vif") == 0) {
bss->ssid.per_sta_vif = atoi(pos);
} else if (os_strcmp(buf, "vlan_file") == 0) {
diff --git a/src/ap/ap_config.h b/src/ap/ap_config.h
index e4340952e..6884d30be 100644
--- a/src/ap/ap_config.h
+++ b/src/ap/ap_config.h
@@ -121,6 +121,7 @@ struct hostapd_ssid {
#define DYNAMIC_VLAN_OPTIONAL 1
#define DYNAMIC_VLAN_REQUIRED 2
int dynamic_vlan;
+ int vlan_no_bridge;
#define DYNAMIC_VLAN_NAMING_WITHOUT_DEVICE 0
#define DYNAMIC_VLAN_NAMING_WITH_DEVICE 1
#define DYNAMIC_VLAN_NAMING_END 2
diff --git a/src/ap/vlan_full.c b/src/ap/vlan_full.c
index 19aa3c649..053d6338e 100644
--- a/src/ap/vlan_full.c
+++ b/src/ap/vlan_full.c
@@ -475,6 +475,9 @@ void vlan_newlink(const char *ifname, struct hostapd_data *hapd)
if (!vlan)
return;
+ if (hapd->conf->ssid.vlan_no_bridge)
+ goto out;
+
vlan->configured = 1;
notempty = vlan->vlan_desc.notempty;
@@ -506,6 +509,7 @@ void vlan_newlink(const char *ifname, struct hostapd_data *hapd)
ifname, br_name, tagged[i], hapd);
}
+out:
ifconfig_up(ifname);
}

View File

@ -1,35 +0,0 @@
From 5a171ddcfab8d1a51e17e73e322d194c99d12092 Mon Sep 17 00:00:00 2001
From: OpenEmbedded <oe.patch@oe>
Date: Thu, 15 Sep 2022 12:35:29 +0000
---
hostapd/config_file.c | 2 ++
src/ap/ap_drv_ops.c | 2 --
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/hostapd/config_file.c b/hostapd/config_file.c
index 7fcbb0be3..24f044ae2 100644
--- a/hostapd/config_file.c
+++ b/hostapd/config_file.c
@@ -2312,6 +2312,8 @@ static int hostapd_config_fill(struct hostapd_config *conf,
sizeof(conf->bss[0]->iface));
} else if (os_strcmp(buf, "bridge") == 0) {
os_strlcpy(bss->bridge, pos, sizeof(bss->bridge));
+ if (!bss->wds_bridge[0])
+ os_strlcpy(bss->wds_bridge, pos, sizeof(bss->wds_bridge));
} else if (os_strcmp(buf, "vlan_bridge") == 0) {
os_strlcpy(bss->vlan_bridge, pos, sizeof(bss->vlan_bridge));
} else if (os_strcmp(buf, "wds_bridge") == 0) {
diff --git a/src/ap/ap_drv_ops.c b/src/ap/ap_drv_ops.c
index 8af7a0e25..192b30ce1 100644
--- a/src/ap/ap_drv_ops.c
+++ b/src/ap/ap_drv_ops.c
@@ -340,8 +340,6 @@ int hostapd_set_wds_sta(struct hostapd_data *hapd, char *ifname_wds,
return -1;
if (hapd->conf->wds_bridge[0])
bridge = hapd->conf->wds_bridge;
- else if (hapd->conf->bridge[0])
- bridge = hapd->conf->bridge;
return hapd->driver->set_wds_sta(hapd->drv_priv, addr, aid, val,
bridge, ifname_wds);
}

View File

@ -1,104 +0,0 @@
From 0682b469685046b6f963c97edf0c72df4e3728b6 Mon Sep 17 00:00:00 2001
From: OpenEmbedded <oe.patch@oe>
Date: Thu, 15 Sep 2022 12:35:29 +0000
---
hostapd/config_file.c | 8 ++++++++
src/ap/ap_config.h | 2 ++
src/ap/beacon.c | 2 +-
src/ap/hostapd.c | 24 ++++++++++++++++++++++++
src/ap/hostapd.h | 1 +
5 files changed, 36 insertions(+), 1 deletion(-)
diff --git a/hostapd/config_file.c b/hostapd/config_file.c
index 24f044ae2..a7b7b91ae 100644
--- a/hostapd/config_file.c
+++ b/hostapd/config_file.c
@@ -2837,6 +2837,14 @@ static int hostapd_config_fill(struct hostapd_config *conf,
line, bss->max_num_sta, MAX_STA_COUNT);
return 1;
}
+ } else if (os_strcmp(buf, "iface_max_num_sta") == 0) {
+ conf->max_num_sta = atoi(pos);
+ if (conf->max_num_sta < 0 ||
+ conf->max_num_sta > MAX_STA_COUNT) {
+ wpa_printf(MSG_ERROR, "Line %d: Invalid max_num_sta=%d; allowed range 0..%d",
+ line, conf->max_num_sta, MAX_STA_COUNT);
+ return 1;
+ }
} else if (os_strcmp(buf, "wpa") == 0) {
bss->wpa = atoi(pos);
} else if (os_strcmp(buf, "extended_key_id") == 0) {
diff --git a/src/ap/ap_config.h b/src/ap/ap_config.h
index 6884d30be..5c466d529 100644
--- a/src/ap/ap_config.h
+++ b/src/ap/ap_config.h
@@ -1007,6 +1007,8 @@ struct hostapd_config {
unsigned int track_sta_max_num;
unsigned int track_sta_max_age;
+ int max_num_sta;
+
char country[3]; /* first two octets: country code as described in
* ISO/IEC 3166-1. Third octet:
* ' ' (ascii 32): all environments
diff --git a/src/ap/beacon.c b/src/ap/beacon.c
index 7c9b589e0..4e02739e5 100644
--- a/src/ap/beacon.c
+++ b/src/ap/beacon.c
@@ -1135,7 +1135,7 @@ void handle_probe_req(struct hostapd_data *hapd,
if (hapd->conf->no_probe_resp_if_max_sta &&
is_multicast_ether_addr(mgmt->da) &&
is_multicast_ether_addr(mgmt->bssid) &&
- hapd->num_sta >= hapd->conf->max_num_sta &&
+ hostapd_check_max_sta(hapd) &&
!ap_get_sta(hapd, mgmt->sa)) {
wpa_printf(MSG_MSGDUMP, "%s: Ignore Probe Request from " MACSTR
" since no room for additional STA",
diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c
index 72ab76e93..377436263 100644
--- a/src/ap/hostapd.c
+++ b/src/ap/hostapd.c
@@ -241,6 +241,30 @@ static int hostapd_iface_conf_changed(struct hostapd_config *newconf,
}
+static inline int hostapd_iface_num_sta(struct hostapd_iface *iface)
+{
+ int num_sta = 0;
+ int i;
+
+ for (i = 0; i < iface->num_bss; i++)
+ num_sta += iface->bss[i]->num_sta;
+
+ return num_sta;
+}
+
+
+int hostapd_check_max_sta(struct hostapd_data *hapd)
+{
+ if (hapd->num_sta >= hapd->conf->max_num_sta)
+ return 1;
+
+ if (hapd->iconf->max_num_sta &&
+ hostapd_iface_num_sta(hapd->iface) >= hapd->iconf->max_num_sta)
+ return 1;
+
+ return 0;
+}
+
int hostapd_reload_config(struct hostapd_iface *iface, int reconf)
{
struct hapd_interfaces *interfaces = iface->interfaces;
diff --git a/src/ap/hostapd.h b/src/ap/hostapd.h
index 0c1bca809..0e588ce91 100644
--- a/src/ap/hostapd.h
+++ b/src/ap/hostapd.h
@@ -698,6 +698,7 @@ void hostapd_cleanup_cs_params(struct hostapd_data *hapd);
void hostapd_periodic_iface(struct hostapd_iface *iface);
int hostapd_owe_trans_get_info(struct hostapd_data *hapd);
void hostapd_ocv_check_csa_sa_query(void *eloop_ctx, void *timeout_ctx);
+int hostapd_check_max_sta(struct hostapd_data *hapd);
void hostapd_switch_color(struct hostapd_data *hapd, u64 bitmap);
void hostapd_cleanup_cca_params(struct hostapd_data *hapd);

View File

@ -1,54 +0,0 @@
From 5326cc72099d17c8b4746e2d5c04f70805d42ccd Mon Sep 17 00:00:00 2001
From: OpenEmbedded <oe.patch@oe>
Date: Thu, 15 Sep 2022 12:35:29 +0000
---
hostapd/config_file.c | 2 ++
src/ap/ap_config.h | 1 +
src/ap/wpa_auth_glue.c | 8 ++++++--
3 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/hostapd/config_file.c b/hostapd/config_file.c
index a7b7b91ae..62eaab122 100644
--- a/hostapd/config_file.c
+++ b/hostapd/config_file.c
@@ -2996,6 +2996,8 @@ static int hostapd_config_fill(struct hostapd_config *conf,
wpa_printf(MSG_INFO,
"Line %d: Obsolete peerkey parameter ignored", line);
#ifdef CONFIG_IEEE80211R_AP
+ } else if (os_strcmp(buf, "ft_iface") == 0) {
+ os_strlcpy(bss->ft_iface, pos, sizeof(bss->ft_iface));
} else if (os_strcmp(buf, "mobility_domain") == 0) {
if (os_strlen(pos) != 2 * MOBILITY_DOMAIN_ID_LEN ||
hexstr2bin(pos, bss->mobility_domain,
diff --git a/src/ap/ap_config.h b/src/ap/ap_config.h
index 5c466d529..f0ec2fe6a 100644
--- a/src/ap/ap_config.h
+++ b/src/ap/ap_config.h
@@ -283,6 +283,7 @@ struct airtime_sta_weight {
struct hostapd_bss_config {
char iface[IFNAMSIZ + 1];
char bridge[IFNAMSIZ + 1];
+ char ft_iface[IFNAMSIZ + 1];
char vlan_bridge[IFNAMSIZ + 1];
char wds_bridge[IFNAMSIZ + 1];
diff --git a/src/ap/wpa_auth_glue.c b/src/ap/wpa_auth_glue.c
index 5c7075891..e5a9a7b35 100644
--- a/src/ap/wpa_auth_glue.c
+++ b/src/ap/wpa_auth_glue.c
@@ -1593,8 +1593,12 @@ int hostapd_setup_wpa(struct hostapd_data *hapd)
wpa_key_mgmt_ft(hapd->conf->wpa_key_mgmt)) {
const char *ft_iface;
- ft_iface = hapd->conf->bridge[0] ? hapd->conf->bridge :
- hapd->conf->iface;
+ if (hapd->conf->ft_iface[0])
+ ft_iface = hapd->conf->ft_iface;
+ else if (hapd->conf->bridge[0])
+ ft_iface = hapd->conf->bridge;
+ else
+ ft_iface = hapd->conf->iface;
hapd->l2 = l2_packet_init(ft_iface, NULL, ETH_P_RRB,
hostapd_rrb_receive, hapd, 1);
if (!hapd->l2) {

View File

@ -1,82 +0,0 @@
From 86704eeb96106bf9a2d5fdd09b044dca92f719f7 Mon Sep 17 00:00:00 2001
From: OpenEmbedded <oe.patch@oe>
Date: Thu, 15 Sep 2022 12:35:29 +0000
---
hostapd/config_file.c | 2 ++
src/ap/ap_config.h | 1 +
src/ap/x_snoop.c | 15 +++++++++++----
3 files changed, 14 insertions(+), 4 deletions(-)
diff --git a/hostapd/config_file.c b/hostapd/config_file.c
index 62eaab122..7af9f7a72 100644
--- a/hostapd/config_file.c
+++ b/hostapd/config_file.c
@@ -2314,6 +2314,8 @@ static int hostapd_config_fill(struct hostapd_config *conf,
os_strlcpy(bss->bridge, pos, sizeof(bss->bridge));
if (!bss->wds_bridge[0])
os_strlcpy(bss->wds_bridge, pos, sizeof(bss->wds_bridge));
+ } else if (os_strcmp(buf, "snoop_iface") == 0) {
+ os_strlcpy(bss->snoop_iface, pos, sizeof(bss->snoop_iface));
} else if (os_strcmp(buf, "vlan_bridge") == 0) {
os_strlcpy(bss->vlan_bridge, pos, sizeof(bss->vlan_bridge));
} else if (os_strcmp(buf, "wds_bridge") == 0) {
diff --git a/src/ap/ap_config.h b/src/ap/ap_config.h
index f0ec2fe6a..f795ee919 100644
--- a/src/ap/ap_config.h
+++ b/src/ap/ap_config.h
@@ -284,6 +284,7 @@ struct hostapd_bss_config {
char iface[IFNAMSIZ + 1];
char bridge[IFNAMSIZ + 1];
char ft_iface[IFNAMSIZ + 1];
+ char snoop_iface[IFNAMSIZ + 1];
char vlan_bridge[IFNAMSIZ + 1];
char wds_bridge[IFNAMSIZ + 1];
diff --git a/src/ap/x_snoop.c b/src/ap/x_snoop.c
index 029f4de23..30c990fd2 100644
--- a/src/ap/x_snoop.c
+++ b/src/ap/x_snoop.c
@@ -33,14 +33,16 @@ int x_snoop_init(struct hostapd_data *hapd)
hapd->x_snoop_initialized = true;
- if (hostapd_drv_br_port_set_attr(hapd, DRV_BR_PORT_ATTR_HAIRPIN_MODE,
+ if (!conf->snoop_iface[0] &&
+ hostapd_drv_br_port_set_attr(hapd, DRV_BR_PORT_ATTR_HAIRPIN_MODE,
1)) {
wpa_printf(MSG_DEBUG,
"x_snoop: Failed to enable hairpin_mode on the bridge port");
return -1;
}
- if (hostapd_drv_br_port_set_attr(hapd, DRV_BR_PORT_ATTR_PROXYARP, 1)) {
+ if (!conf->snoop_iface[0] &&
+ hostapd_drv_br_port_set_attr(hapd, DRV_BR_PORT_ATTR_PROXYARP, 1)) {
wpa_printf(MSG_DEBUG,
"x_snoop: Failed to enable proxyarp on the bridge port");
return -1;
@@ -54,7 +56,8 @@ int x_snoop_init(struct hostapd_data *hapd)
}
#ifdef CONFIG_IPV6
- if (hostapd_drv_br_set_net_param(hapd, DRV_BR_MULTICAST_SNOOPING, 1)) {
+ if (!conf->snoop_iface[0] &&
+ hostapd_drv_br_set_net_param(hapd, DRV_BR_MULTICAST_SNOOPING, 1)) {
wpa_printf(MSG_DEBUG,
"x_snoop: Failed to enable multicast snooping on the bridge");
return -1;
@@ -73,8 +76,12 @@ x_snoop_get_l2_packet(struct hostapd_data *hapd,
{
struct hostapd_bss_config *conf = hapd->conf;
struct l2_packet_data *l2;
+ const char *ifname = conf->bridge;
- l2 = l2_packet_init(conf->bridge, NULL, ETH_P_ALL, handler, hapd, 1);
+ if (conf->snoop_iface[0])
+ ifname = conf->snoop_iface;
+
+ l2 = l2_packet_init(ifname, NULL, ETH_P_ALL, handler, hapd, 1);
if (l2 == NULL) {
wpa_printf(MSG_DEBUG,
"x_snoop: Failed to initialize L2 packet processing %s",

View File

@ -1,116 +0,0 @@
From 9279da2d91d4c8c4a33449e0a6fe0f03e91a40e5 Mon Sep 17 00:00:00 2001
From: OpenEmbedded <oe.patch@oe>
Date: Thu, 15 Sep 2022 12:35:29 +0000
---
hostapd/config_file.c | 6 +++---
src/ap/hostapd.c | 2 +-
src/ap/ieee802_11_shared.c | 2 --
wpa_supplicant/events.c | 6 ------
4 files changed, 4 insertions(+), 12 deletions(-)
diff --git a/hostapd/config_file.c b/hostapd/config_file.c
index 7af9f7a72..e57c78b70 100644
--- a/hostapd/config_file.c
+++ b/hostapd/config_file.c
@@ -1598,6 +1598,8 @@ static int parse_anqp_elem(struct hostapd_bss_config *bss, char *buf, int line)
return 0;
}
+#endif /* CONFIG_INTERWORKING */
+
static int parse_qos_map_set(struct hostapd_bss_config *bss,
char *buf, int line)
@@ -1639,8 +1641,6 @@ static int parse_qos_map_set(struct hostapd_bss_config *bss,
return 0;
}
-#endif /* CONFIG_INTERWORKING */
-
#ifdef CONFIG_HS20
static int hs20_parse_conn_capab(struct hostapd_bss_config *bss, char *buf,
@@ -4042,10 +4042,10 @@ static int hostapd_config_fill(struct hostapd_config *conf,
bss->gas_frag_limit = val;
} else if (os_strcmp(buf, "gas_comeback_delay") == 0) {
bss->gas_comeback_delay = atoi(pos);
+#endif /* CONFIG_INTERWORKING */
} else if (os_strcmp(buf, "qos_map_set") == 0) {
if (parse_qos_map_set(bss, pos, line) < 0)
return 1;
-#endif /* CONFIG_INTERWORKING */
#ifdef CONFIG_RADIUS_TEST
} else if (os_strcmp(buf, "dump_msk_file") == 0) {
os_free(bss->dump_msk_file);
diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c
index 377436263..e61ac39b8 100644
--- a/src/ap/hostapd.c
+++ b/src/ap/hostapd.c
@@ -1424,6 +1424,7 @@ static int hostapd_setup_bss(struct hostapd_data *hapd, int first)
wpa_printf(MSG_ERROR, "GAS server initialization failed");
return -1;
}
+#endif /* CONFIG_INTERWORKING */
if (conf->qos_map_set_len &&
hostapd_drv_set_qos_map(hapd, conf->qos_map_set,
@@ -1431,7 +1432,6 @@ static int hostapd_setup_bss(struct hostapd_data *hapd, int first)
wpa_printf(MSG_ERROR, "Failed to initialize QoS Map");
return -1;
}
-#endif /* CONFIG_INTERWORKING */
if (conf->bss_load_update_period && bss_load_update_init(hapd)) {
wpa_printf(MSG_ERROR, "BSS Load initialization failed");
diff --git a/src/ap/ieee802_11_shared.c b/src/ap/ieee802_11_shared.c
index 615489511..691b1394a 100644
--- a/src/ap/ieee802_11_shared.c
+++ b/src/ap/ieee802_11_shared.c
@@ -1098,13 +1098,11 @@ u8 * hostapd_eid_rsnxe(struct hostapd_data *hapd, u8 *eid, size_t len)
u16 check_ext_capab(struct hostapd_data *hapd, struct sta_info *sta,
const u8 *ext_capab_ie, size_t ext_capab_ie_len)
{
-#ifdef CONFIG_INTERWORKING
/* check for QoS Map support */
if (ext_capab_ie_len >= 5) {
if (ext_capab_ie[4] & 0x01)
sta->qos_map_enabled = 1;
}
-#endif /* CONFIG_INTERWORKING */
if (ext_capab_ie_len > 0) {
sta->ecsa_supported = !!(ext_capab_ie[0] & BIT(2));
diff --git a/wpa_supplicant/events.c b/wpa_supplicant/events.c
index 86a0dc7fa..0bac5f2c2 100644
--- a/wpa_supplicant/events.c
+++ b/wpa_supplicant/events.c
@@ -2586,8 +2586,6 @@ void wnm_bss_keep_alive_deinit(struct wpa_supplicant *wpa_s)
}
-#ifdef CONFIG_INTERWORKING
-
static int wpas_qos_map_set(struct wpa_supplicant *wpa_s, const u8 *qos_map,
size_t len)
{
@@ -2620,8 +2618,6 @@ static void interworking_process_assoc_resp(struct wpa_supplicant *wpa_s,
}
}
-#endif /* CONFIG_INTERWORKING */
-
static void multi_ap_process_assoc_resp(struct wpa_supplicant *wpa_s,
const u8 *ies, size_t ies_len)
@@ -2954,10 +2950,8 @@ static int wpa_supplicant_event_associnfo(struct wpa_supplicant *wpa_s,
wnm_process_assoc_resp(wpa_s, data->assoc_info.resp_ies,
data->assoc_info.resp_ies_len);
#endif /* CONFIG_WNM */
-#ifdef CONFIG_INTERWORKING
interworking_process_assoc_resp(wpa_s, data->assoc_info.resp_ies,
data->assoc_info.resp_ies_len);
-#endif /* CONFIG_INTERWORKING */
if (wpa_s->hw_capab == CAPAB_VHT &&
get_ie(data->assoc_info.resp_ies,
data->assoc_info.resp_ies_len, WLAN_EID_VHT_CAP))

View File

@ -1,22 +0,0 @@
From 898a6cd8ef1eefa3c214d0b558959a4f52084706 Mon Sep 17 00:00:00 2001
From: OpenEmbedded <oe.patch@oe>
Date: Thu, 15 Sep 2022 12:35:29 +0000
---
src/ap/ap_drv_ops.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/ap/ap_drv_ops.c b/src/ap/ap_drv_ops.c
index 192b30ce1..f7ad3edc7 100644
--- a/src/ap/ap_drv_ops.c
+++ b/src/ap/ap_drv_ops.c
@@ -864,7 +864,8 @@ int hostapd_start_dfs_cac(struct hostapd_iface *iface,
int hostapd_drv_set_qos_map(struct hostapd_data *hapd,
const u8 *qos_map_set, u8 qos_map_set_len)
{
- if (!hapd->driver || !hapd->driver->set_qos_map || !hapd->drv_priv)
+ if (!hapd->driver || !hapd->driver->set_qos_map || !hapd->drv_priv ||
+ !(hapd->iface->drv_flags & WPA_DRIVER_FLAGS_QOS_MAPPING))
return 0;
return hapd->driver->set_qos_map(hapd->drv_priv, qos_map_set,
qos_map_set_len);

View File

@ -0,0 +1,58 @@
From 52f53957d41082597fbdfc5b8d79ee72d85cea36 Mon Sep 17 00:00:00 2001
From: Rosen Penev <rosenp@gmail.com>
Date: Sat, 24 Aug 2019 15:01:16 -0700
Subject: [PATCH] os_sleep: Use nanosleep for POSIX versions 2008 and higher
uClibc-ng optionally disabled deprecated POSIX functions like usleep,
causing compilation failures. This switches to nanosleep while retaining
support for older libcs that do not support nanosleep.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
---
src/utils/os_internal.c | 6 ++++++
src/utils/os_unix.c | 6 ++++++
2 files changed, 12 insertions(+)
diff --git a/src/utils/os_internal.c b/src/utils/os_internal.c
index 474c8a372..feade6ee6 100644
--- a/src/utils/os_internal.c
+++ b/src/utils/os_internal.c
@@ -25,10 +25,16 @@
void os_sleep(os_time_t sec, os_time_t usec)
{
+#if defined(_POSIX_C_SOURCE) && (_POSIX_C_SOURCE >= 200809L)
+ const struct timespec req = { sec, usec * 1000 };
+
+ nanosleep(&req, NULL);
+#else
if (sec)
sleep(sec);
if (usec)
usleep(usec);
+#endif
}
diff --git a/src/utils/os_unix.c b/src/utils/os_unix.c
index 6231974cf..c0a1cceb1 100644
--- a/src/utils/os_unix.c
+++ b/src/utils/os_unix.c
@@ -50,10 +50,16 @@ struct os_alloc_trace {
void os_sleep(os_time_t sec, os_time_t usec)
{
+#if defined(_POSIX_C_SOURCE) && (_POSIX_C_SOURCE >= 200809L)
+ const struct timespec req = { sec, usec * 1000 };
+
+ nanosleep(&req, NULL);
+#else
if (sec)
sleep(sec);
if (usec)
usleep(usec);
+#endif
}

View File

@ -1,42 +0,0 @@
diff --git a/wpa_supplicant/ap.c b/wpa_supplicant/ap.c
index 992c0a056..d0cc641e5 100644
--- a/wpa_supplicant/ap.c
+++ b/wpa_supplicant/ap.c
@@ -1613,7 +1613,7 @@ int ap_ctrl_iface_bss_tm_req(struct wpa_supplicant *wpa_s, const char *buf)
#endif /* CONFIG_WNM_AP */
-
+#ifdef CONFIG_CTRL_IFACE_ACL
int ap_ctrl_iface_acl_add_mac(struct wpa_supplicant *wpa_s,
enum macaddr_acl acl_type,
const char *buf)
@@ -1748,7 +1748,7 @@ int ap_ctrl_iface_set_acl(struct wpa_supplicant *wpa_s)
return hostapd_set_acl(hapd);
}
-
+#endif /* CONFIG_CTRL_IFACE_ACL */
#endif /* CONFIG_CTRL_IFACE */
diff --git a/wpa_supplicant/ctrl_iface.c b/wpa_supplicant/ctrl_iface.c
index bb6b1f9ac..6016e843e 100644
--- a/wpa_supplicant/ctrl_iface.c
+++ b/wpa_supplicant/ctrl_iface.c
@@ -12050,6 +12050,7 @@ char * wpa_supplicant_ctrl_iface_process(struct wpa_supplicant *wpa_s,
} else if (os_strcmp(buf, "UPDATE_BEACON") == 0) {
if (wpas_ap_update_beacon(wpa_s))
reply_len = -1;
+#ifdef CONFIG_CTRL_IFACE_ACL
} else if (os_strncmp(buf, "ACCEPT_ACL ", 11) == 0) {
if (os_strncmp(buf + 11, "ADD_MAC ", 8) == 0) {
if (ap_ctrl_iface_acl_add_mac(wpa_s,
@@ -12102,6 +12103,7 @@ char * wpa_supplicant_ctrl_iface_process(struct wpa_supplicant *wpa_s,
} else {
reply_len = -1;
}
+#endif
#endif /* CONFIG_AP */
} else if (os_strcmp(buf, "SUSPEND") == 0) {
wpas_notify_suspend(wpa_s->global);

View File

@ -1,835 +0,0 @@
diff --git a/hostapd/Android.mk b/hostapd/Android.mk
index 2f8e8862e..21708132c 100644
--- a/hostapd/Android.mk
+++ b/hostapd/Android.mk
@@ -210,6 +210,11 @@ endif
L_CFLAGS += -DCONFIG_CTRL_IFACE -DCONFIG_CTRL_IFACE_UNIX
+ifdef CONFIG_IAPP
+L_CFLAGS += -DCONFIG_IAPP
+OBJS += src/ap/iapp.c
+endif
+
ifdef CONFIG_RSN_PREAUTH
L_CFLAGS += -DCONFIG_RSN_PREAUTH
CONFIG_L2_PACKET=y
diff --git a/hostapd/Makefile b/hostapd/Makefile
index 19a88e0fd..64c29ef33 100644
--- a/hostapd/Makefile
+++ b/hostapd/Makefile
@@ -254,6 +254,11 @@ ifndef CONFIG_NO_CTRL_IFACE
CFLAGS += -DCONFIG_CTRL_IFACE
endif
+ifdef CONFIG_IAPP
+CFLAGS += -DCONFIG_IAPP
+OBJS += ../src/ap/iapp.o
+endif
+
ifdef CONFIG_RSN_PREAUTH
CFLAGS += -DCONFIG_RSN_PREAUTH
CONFIG_L2_PACKET=y
diff --git a/hostapd/android.config b/hostapd/android.config
index c8b3afabe..095f930da 100644
--- a/hostapd/android.config
+++ b/hostapd/android.config
@@ -41,6 +41,9 @@ CONFIG_DRIVER_NL80211_QCA=y
# Driver interface for no driver (e.g., RADIUS server only)
#CONFIG_DRIVER_NONE=y
+# IEEE 802.11F/IAPP
+#CONFIG_IAPP=y
+
# WPA2/IEEE 802.11i RSN pre-authentication
#CONFIG_RSN_PREAUTH=y
diff --git a/hostapd/config_file.c b/hostapd/config_file.c
index e57c78b70..a388703fb 100644
--- a/hostapd/config_file.c
+++ b/hostapd/config_file.c
@@ -2675,7 +2675,8 @@ static int hostapd_config_fill(struct hostapd_config *conf,
bss->eapol_key_index_workaround = atoi(pos);
#ifdef CONFIG_IAPP
} else if (os_strcmp(buf, "iapp_interface") == 0) {
- wpa_printf(MSG_INFO, "DEPRECATED: iapp_interface not used");
+ bss->ieee802_11f = 1;
+ os_strlcpy(bss->iapp_iface, pos, sizeof(bss->iapp_iface));
#endif /* CONFIG_IAPP */
} else if (os_strcmp(buf, "own_ip_addr") == 0) {
if (hostapd_parse_ip_addr(pos, &bss->own_ip_addr)) {
diff --git a/hostapd/defconfig b/hostapd/defconfig
index a9eab4d9c..7da1da555 100644
--- a/hostapd/defconfig
+++ b/hostapd/defconfig
@@ -44,6 +44,9 @@ CONFIG_LIBNL32=y
# Driver interface for no driver (e.g., RADIUS server only)
#CONFIG_DRIVER_NONE=y
+# IEEE 802.11F/IAPP
+CONFIG_IAPP=y
+
# WPA2/IEEE 802.11i RSN pre-authentication
CONFIG_RSN_PREAUTH=y
diff --git a/hostapd/hostapd.conf b/hostapd/hostapd.conf
index f37d5634b..594eb0d17 100644
--- a/hostapd/hostapd.conf
+++ b/hostapd/hostapd.conf
@@ -41,6 +41,7 @@ interface=wlan0
# bit 2 (4) = RADIUS
# bit 3 (8) = WPA
# bit 4 (16) = driver interface
+# bit 5 (32) = IAPP
# bit 6 (64) = MLME
#
# Levels (minimum value for logged events):
@@ -1438,6 +1439,11 @@ eap_server=0
# Whether to enable ERP on the EAP server.
#eap_server_erp=1
+##### IEEE 802.11f - Inter-Access Point Protocol (IAPP) #######################
+
+# Interface to be used for IAPP broadcast packets
+#iapp_interface=eth0
+
##### RADIUS client configuration #############################################
# for IEEE 802.1X with external Authentication Server, IEEE 802.11
diff --git a/hostapd/main.c b/hostapd/main.c
index 0d0e92e9e..8de88e513 100644
--- a/hostapd/main.c
+++ b/hostapd/main.c
@@ -84,6 +84,9 @@ static void hostapd_logger_cb(void *ctx, const u8 *addr, unsigned int module,
case HOSTAPD_MODULE_DRIVER:
module_str = "DRIVER";
break;
+ case HOSTAPD_MODULE_IAPP:
+ module_str = "IAPP";
+ break;
case HOSTAPD_MODULE_MLME:
module_str = "MLME";
break;
diff --git a/src/ap/Makefile b/src/ap/Makefile
index a1e9b7c44..27a63dac0 100644
--- a/src/ap/Makefile
+++ b/src/ap/Makefile
@@ -8,6 +8,7 @@ CFLAGS += -DCONFIG_IEEE80211R_AP
CFLAGS += -DCONFIG_WPS
CFLAGS += -DCONFIG_PROXYARP
CFLAGS += -DCONFIG_IPV6
+CFLAGS += -DCONFIG_IAPP
CFLAGS += -DCONFIG_AIRTIME_POLICY
LIB_OBJS= \
@@ -30,6 +31,7 @@ LIB_OBJS= \
hostapd.o \
hs20.o \
hw_features.o \
+ iapp.o \
ieee802_11_auth.o \
ieee802_11.o \
ieee802_11_ht.o \
diff --git a/src/ap/ap_config.h b/src/ap/ap_config.h
index f795ee919..529ad0b12 100644
--- a/src/ap/ap_config.h
+++ b/src/ap/ap_config.h
@@ -346,6 +346,10 @@ struct hostapd_bss_config {
bool eap_skip_prot_success;
#endif /* CONFIG_TESTING_OPTIONS */
+ int ieee802_11f; /* use IEEE 802.11f (IAPP) */
+ char iapp_iface[IFNAMSIZ + 1]; /* interface used with IAPP broadcast
+ * frames */
+
enum macaddr_acl macaddr_acl;
struct mac_acl_entry *accept_mac;
int num_accept_mac;
diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c
index 1bd525fe9..a4bf68e6f 100644
--- a/src/ap/hostapd.c
+++ b/src/ap/hostapd.c
@@ -29,6 +29,7 @@
#include "accounting.h"
#include "ap_list.h"
#include "beacon.h"
+#include "iapp.h"
#include "ieee802_1x.h"
#include "ieee802_11_auth.h"
#include "vlan_init.h"
@@ -455,6 +456,8 @@ void hostapd_free_hapd_data(struct hostapd_data *hapd)
hapd->beacon_set_done = 0;
wpa_printf(MSG_DEBUG, "%s(%s)", __func__, hapd->conf->iface);
+ iapp_deinit(hapd->iapp);
+ hapd->iapp = NULL;
accounting_deinit(hapd);
hostapd_deinit_wpa(hapd);
vlan_deinit(hapd);
@@ -1417,6 +1420,13 @@ static int hostapd_setup_bss(struct hostapd_data *hapd, int first)
return -1;
}
+ if (conf->ieee802_11f &&
+ (hapd->iapp = iapp_init(hapd, conf->iapp_iface)) == NULL) {
+ wpa_printf(MSG_ERROR, "IEEE 802.11F (IAPP) initialization "
+ "failed.");
+ return -1;
+ }
+
#ifdef CONFIG_INTERWORKING
if (gas_serv_init(hapd)) {
wpa_printf(MSG_ERROR, "GAS server initialization failed");
@@ -3313,6 +3323,10 @@ void hostapd_new_assoc_sta(struct hostapd_data *hapd, struct sta_info *sta,
ap_sta_clear_disconnect_timeouts(hapd, sta);
sta->post_csa_sa_query = 0;
+ /* IEEE 802.11F (IAPP) */
+ if (hapd->conf->ieee802_11f)
+ iapp_new_station(hapd->iapp, sta);
+
#ifdef CONFIG_P2P
if (sta->p2p_ie == NULL && !sta->no_p2p_set) {
sta->no_p2p_set = 1;
diff --git a/src/ap/hostapd.h b/src/ap/hostapd.h
index aba04a925..ae4f0b26f 100644
--- a/src/ap/hostapd.h
+++ b/src/ap/hostapd.h
@@ -210,6 +210,8 @@ struct hostapd_data {
u64 acct_session_id;
struct radius_das_data *radius_das;
+ struct iapp_data *iapp;
+
struct hostapd_cached_radius_acl *acl_cache;
struct hostapd_acl_query_data *acl_queries;
diff --git a/src/ap/iapp.c b/src/ap/iapp.c
new file mode 100644
index 000000000..8faebfded
--- /dev/null
+++ b/src/ap/iapp.c
@@ -0,0 +1,542 @@
+/*
+ * hostapd / IEEE 802.11F-2003 Inter-Access Point Protocol (IAPP)
+ * Copyright (c) 2002-2007, Jouni Malinen <j@w1.fi>
+ *
+ * This software may be distributed under the terms of the BSD license.
+ * See README for more details.
+ *
+ * Note: IEEE 802.11F-2003 was a experimental use specification. It has expired
+ * and IEEE has withdrawn it. In other words, it is likely better to look at
+ * using some other mechanism for AP-to-AP communication than extending the
+ * implementation here.
+ */
+
+/* TODO:
+ * Level 1: no administrative or security support
+ * (e.g., static BSSID to IP address mapping in each AP)
+ * Level 2: support for dynamic mapping of BSSID to IP address
+ * Level 3: support for encryption and authentication of IAPP messages
+ * - add support for MOVE-notify and MOVE-response (this requires support for
+ * finding out IP address for previous AP using RADIUS)
+ * - add support for Send- and ACK-Security-Block to speedup IEEE 802.1X during
+ * reassociation to another AP
+ * - implement counters etc. for IAPP MIB
+ * - verify endianness of fields in IAPP messages; are they big-endian as
+ * used here?
+ * - RADIUS connection for AP registration and BSSID to IP address mapping
+ * - TCP connection for IAPP MOVE, CACHE
+ * - broadcast ESP for IAPP ADD-notify
+ * - ESP for IAPP MOVE messages
+ * - security block sending/processing
+ * - IEEE 802.11 context transfer
+ */
+
+#include "utils/includes.h"
+#include <net/if.h>
+#include <sys/ioctl.h>
+#include <netpacket/packet.h>
+
+#include "utils/common.h"
+#include "utils/eloop.h"
+#include "common/ieee802_11_defs.h"
+#include "hostapd.h"
+#include "ap_config.h"
+#include "ieee802_11.h"
+#include "sta_info.h"
+#include "iapp.h"
+
+
+#define IAPP_MULTICAST "224.0.1.178"
+#define IAPP_UDP_PORT 3517
+#define IAPP_TCP_PORT 3517
+
+struct iapp_hdr {
+ u8 version;
+ u8 command;
+ be16 identifier;
+ be16 length;
+ /* followed by length-6 octets of data */
+} __attribute__ ((packed));
+
+#define IAPP_VERSION 0
+
+enum IAPP_COMMAND {
+ IAPP_CMD_ADD_notify = 0,
+ IAPP_CMD_MOVE_notify = 1,
+ IAPP_CMD_MOVE_response = 2,
+ IAPP_CMD_Send_Security_Block = 3,
+ IAPP_CMD_ACK_Security_Block = 4,
+ IAPP_CMD_CACHE_notify = 5,
+ IAPP_CMD_CACHE_response = 6,
+};
+
+
+/* ADD-notify - multicast UDP on the local LAN */
+struct iapp_add_notify {
+ u8 addr_len; /* ETH_ALEN */
+ u8 reserved;
+ u8 mac_addr[ETH_ALEN];
+ be16 seq_num;
+} __attribute__ ((packed));
+
+
+/* Layer 2 Update frame (802.2 Type 1 LLC XID Update response) */
+struct iapp_layer2_update {
+ u8 da[ETH_ALEN]; /* broadcast */
+ u8 sa[ETH_ALEN]; /* STA addr */
+ be16 len; /* 6 */
+ u8 dsap; /* null DSAP address */
+ u8 ssap; /* null SSAP address, CR=Response */
+ u8 control;
+ u8 xid_info[3];
+} __attribute__ ((packed));
+
+
+/* MOVE-notify - unicast TCP */
+struct iapp_move_notify {
+ u8 addr_len; /* ETH_ALEN */
+ u8 reserved;
+ u8 mac_addr[ETH_ALEN];
+ u16 seq_num;
+ u16 ctx_block_len;
+ /* followed by ctx_block_len bytes */
+} __attribute__ ((packed));
+
+
+/* MOVE-response - unicast TCP */
+struct iapp_move_response {
+ u8 addr_len; /* ETH_ALEN */
+ u8 status;
+ u8 mac_addr[ETH_ALEN];
+ u16 seq_num;
+ u16 ctx_block_len;
+ /* followed by ctx_block_len bytes */
+} __attribute__ ((packed));
+
+enum {
+ IAPP_MOVE_SUCCESSFUL = 0,
+ IAPP_MOVE_DENIED = 1,
+ IAPP_MOVE_STALE_MOVE = 2,
+};
+
+
+/* CACHE-notify */
+struct iapp_cache_notify {
+ u8 addr_len; /* ETH_ALEN */
+ u8 reserved;
+ u8 mac_addr[ETH_ALEN];
+ u16 seq_num;
+ u8 current_ap[ETH_ALEN];
+ u16 ctx_block_len;
+ /* ctx_block_len bytes of context block followed by 16-bit context
+ * timeout */
+} __attribute__ ((packed));
+
+
+/* CACHE-response - unicast TCP */
+struct iapp_cache_response {
+ u8 addr_len; /* ETH_ALEN */
+ u8 status;
+ u8 mac_addr[ETH_ALEN];
+ u16 seq_num;
+} __attribute__ ((packed));
+
+enum {
+ IAPP_CACHE_SUCCESSFUL = 0,
+ IAPP_CACHE_STALE_CACHE = 1,
+};
+
+
+/* Send-Security-Block - unicast TCP */
+struct iapp_send_security_block {
+ u8 iv[8];
+ u16 sec_block_len;
+ /* followed by sec_block_len bytes of security block */
+} __attribute__ ((packed));
+
+
+/* ACK-Security-Block - unicast TCP */
+struct iapp_ack_security_block {
+ u8 iv[8];
+ u8 new_ap_ack_authenticator[48];
+} __attribute__ ((packed));
+
+
+struct iapp_data {
+ struct hostapd_data *hapd;
+ u16 identifier; /* next IAPP identifier */
+ struct in_addr own, multicast;
+ int udp_sock;
+ int packet_sock;
+};
+
+
+static void iapp_send_add(struct iapp_data *iapp, u8 *mac_addr, u16 seq_num)
+{
+ char buf[128];
+ struct iapp_hdr *hdr;
+ struct iapp_add_notify *add;
+ struct sockaddr_in addr;
+
+ /* Send IAPP ADD-notify to remove possible association from other APs
+ */
+
+ hdr = (struct iapp_hdr *) buf;
+ hdr->version = IAPP_VERSION;
+ hdr->command = IAPP_CMD_ADD_notify;
+ hdr->identifier = host_to_be16(iapp->identifier++);
+ hdr->length = host_to_be16(sizeof(*hdr) + sizeof(*add));
+
+ add = (struct iapp_add_notify *) (hdr + 1);
+ add->addr_len = ETH_ALEN;
+ add->reserved = 0;
+ os_memcpy(add->mac_addr, mac_addr, ETH_ALEN);
+
+ add->seq_num = host_to_be16(seq_num);
+
+ os_memset(&addr, 0, sizeof(addr));
+ addr.sin_family = AF_INET;
+ addr.sin_addr.s_addr = iapp->multicast.s_addr;
+ addr.sin_port = htons(IAPP_UDP_PORT);
+ if (sendto(iapp->udp_sock, buf, (char *) (add + 1) - buf, 0,
+ (struct sockaddr *) &addr, sizeof(addr)) < 0)
+ wpa_printf(MSG_INFO, "sendto[IAPP-ADD]: %s", strerror(errno));
+}
+
+
+static void iapp_send_layer2_update(struct iapp_data *iapp, u8 *addr)
+{
+ struct iapp_layer2_update msg;
+
+ /* Send Level 2 Update Frame to update forwarding tables in layer 2
+ * bridge devices */
+
+ /* 802.2 Type 1 Logical Link Control (LLC) Exchange Identifier (XID)
+ * Update response frame; IEEE Std 802.2-1998, 5.4.1.2.1 */
+
+ os_memset(msg.da, 0xff, ETH_ALEN);
+ os_memcpy(msg.sa, addr, ETH_ALEN);
+ msg.len = host_to_be16(6);
+ msg.dsap = 0; /* NULL DSAP address */
+ msg.ssap = 0x01; /* NULL SSAP address, CR Bit: Response */
+ msg.control = 0xaf; /* XID response lsb.1111F101.
+ * F=0 (no poll command; unsolicited frame) */
+ msg.xid_info[0] = 0x81; /* XID format identifier */
+ msg.xid_info[1] = 1; /* LLC types/classes: Type 1 LLC */
+ msg.xid_info[2] = 1 << 1; /* XID sender's receive window size (RW)
+ * FIX: what is correct RW with 802.11? */
+
+ if (send(iapp->packet_sock, &msg, sizeof(msg), 0) < 0)
+ wpa_printf(MSG_INFO, "send[L2 Update]: %s", strerror(errno));
+}
+
+
+/**
+ * iapp_new_station - IAPP processing for a new STA
+ * @iapp: IAPP data
+ * @sta: The associated station
+ */
+void iapp_new_station(struct iapp_data *iapp, struct sta_info *sta)
+{
+ u16 seq = 0; /* TODO */
+
+ if (iapp == NULL)
+ return;
+
+ /* IAPP-ADD.request(MAC Address, Sequence Number, Timeout) */
+ hostapd_logger(iapp->hapd, sta->addr, HOSTAPD_MODULE_IAPP,
+ HOSTAPD_LEVEL_DEBUG, "IAPP-ADD.request(seq=%d)", seq);
+ iapp_send_layer2_update(iapp, sta->addr);
+ iapp_send_add(iapp, sta->addr, seq);
+
+ /* TODO: If this was reassociation:
+ * IAPP-MOVE.request(MAC Address, Sequence Number, Old AP,
+ * Context Block, Timeout)
+ * TODO: Send IAPP-MOVE to the old AP; Map Old AP BSSID to
+ * IP address */
+}
+
+
+static void iapp_process_add_notify(struct iapp_data *iapp,
+ struct sockaddr_in *from,
+ struct iapp_hdr *hdr, int len)
+{
+ struct iapp_add_notify *add = (struct iapp_add_notify *) (hdr + 1);
+ struct sta_info *sta;
+
+ if (len != sizeof(*add)) {
+ wpa_printf(MSG_INFO, "Invalid IAPP-ADD packet length %d (expected %lu)",
+ len, (unsigned long) sizeof(*add));
+ return;
+ }
+
+ sta = ap_get_sta(iapp->hapd, add->mac_addr);
+
+ /* IAPP-ADD.indication(MAC Address, Sequence Number) */
+ hostapd_logger(iapp->hapd, add->mac_addr, HOSTAPD_MODULE_IAPP,
+ HOSTAPD_LEVEL_INFO,
+ "Received IAPP ADD-notify (seq# %d) from %s:%d%s",
+ be_to_host16(add->seq_num),
+ inet_ntoa(from->sin_addr), ntohs(from->sin_port),
+ sta ? "" : " (STA not found)");
+
+ if (!sta)
+ return;
+
+ /* TODO: could use seq_num to try to determine whether last association
+ * to this AP is newer than the one advertised in IAPP-ADD. Although,
+ * this is not really a reliable verification. */
+
+ hostapd_logger(iapp->hapd, add->mac_addr, HOSTAPD_MODULE_IAPP,
+ HOSTAPD_LEVEL_DEBUG,
+ "Removing STA due to IAPP ADD-notify");
+ ap_sta_disconnect(iapp->hapd, sta, NULL, 0);
+}
+
+
+/**
+ * iapp_receive_udp - Process IAPP UDP frames
+ * @sock: File descriptor for the socket
+ * @eloop_ctx: IAPP data (struct iapp_data *)
+ * @sock_ctx: Not used
+ */
+static void iapp_receive_udp(int sock, void *eloop_ctx, void *sock_ctx)
+{
+ struct iapp_data *iapp = eloop_ctx;
+ int len, hlen;
+ unsigned char buf[128];
+ struct sockaddr_in from;
+ socklen_t fromlen;
+ struct iapp_hdr *hdr;
+
+ /* Handle incoming IAPP frames (over UDP/IP) */
+
+ fromlen = sizeof(from);
+ len = recvfrom(iapp->udp_sock, buf, sizeof(buf), 0,
+ (struct sockaddr *) &from, &fromlen);
+ if (len < 0) {
+ wpa_printf(MSG_INFO, "iapp_receive_udp - recvfrom: %s",
+ strerror(errno));
+ return;
+ }
+
+ if (from.sin_addr.s_addr == iapp->own.s_addr)
+ return; /* ignore own IAPP messages */
+
+ hostapd_logger(iapp->hapd, NULL, HOSTAPD_MODULE_IAPP,
+ HOSTAPD_LEVEL_DEBUG,
+ "Received %d byte IAPP frame from %s%s\n",
+ len, inet_ntoa(from.sin_addr),
+ len < (int) sizeof(*hdr) ? " (too short)" : "");
+
+ if (len < (int) sizeof(*hdr))
+ return;
+
+ hdr = (struct iapp_hdr *) buf;
+ hlen = be_to_host16(hdr->length);
+ hostapd_logger(iapp->hapd, NULL, HOSTAPD_MODULE_IAPP,
+ HOSTAPD_LEVEL_DEBUG,
+ "RX: version=%d command=%d id=%d len=%d\n",
+ hdr->version, hdr->command,
+ be_to_host16(hdr->identifier), hlen);
+ if (hdr->version != IAPP_VERSION) {
+ wpa_printf(MSG_INFO, "Dropping IAPP frame with unknown version %d",
+ hdr->version);
+ return;
+ }
+ if (hlen > len) {
+ wpa_printf(MSG_INFO, "Underflow IAPP frame (hlen=%d len=%d)",
+ hlen, len);
+ return;
+ }
+ if (hlen < len) {
+ wpa_printf(MSG_INFO, "Ignoring %d extra bytes from IAPP frame",
+ len - hlen);
+ len = hlen;
+ }
+
+ switch (hdr->command) {
+ case IAPP_CMD_ADD_notify:
+ iapp_process_add_notify(iapp, &from, hdr, len - sizeof(*hdr));
+ break;
+ case IAPP_CMD_MOVE_notify:
+ /* TODO: MOVE is using TCP; so move this to TCP handler once it
+ * is implemented.. */
+ /* IAPP-MOVE.indication(MAC Address, New BSSID,
+ * Sequence Number, AP Address, Context Block) */
+ /* TODO: process */
+ break;
+ default:
+ wpa_printf(MSG_INFO, "Unknown IAPP command %d", hdr->command);
+ break;
+ }
+}
+
+
+struct iapp_data * iapp_init(struct hostapd_data *hapd, const char *iface)
+{
+ struct ifreq ifr;
+ struct sockaddr_ll addr;
+ int ifindex;
+ struct sockaddr_in *paddr, uaddr;
+ struct iapp_data *iapp;
+ struct ip_mreqn mreq;
+ int reuseaddr = 1;
+
+ iapp = os_zalloc(sizeof(*iapp));
+ if (iapp == NULL)
+ return NULL;
+ iapp->hapd = hapd;
+ iapp->udp_sock = iapp->packet_sock = -1;
+
+ /* TODO:
+ * open socket for sending and receiving IAPP frames over TCP
+ */
+
+ iapp->udp_sock = socket(PF_INET, SOCK_DGRAM, 0);
+ if (iapp->udp_sock < 0) {
+ wpa_printf(MSG_INFO, "iapp_init - socket[PF_INET,SOCK_DGRAM]: %s",
+ strerror(errno));
+ iapp_deinit(iapp);
+ return NULL;
+ }
+
+ os_memset(&ifr, 0, sizeof(ifr));
+ os_strlcpy(ifr.ifr_name, iface, sizeof(ifr.ifr_name));
+ if (ioctl(iapp->udp_sock, SIOCGIFINDEX, &ifr) != 0) {
+ wpa_printf(MSG_INFO, "iapp_init - ioctl(SIOCGIFINDEX): %s",
+ strerror(errno));
+ iapp_deinit(iapp);
+ return NULL;
+ }
+ ifindex = ifr.ifr_ifindex;
+
+ if (ioctl(iapp->udp_sock, SIOCGIFADDR, &ifr) != 0) {
+ wpa_printf(MSG_INFO, "iapp_init - ioctl(SIOCGIFADDR): %s",
+ strerror(errno));
+ iapp_deinit(iapp);
+ return NULL;
+ }
+ paddr = (struct sockaddr_in *) &ifr.ifr_addr;
+ if (paddr->sin_family != AF_INET) {
+ wpa_printf(MSG_INFO, "IAPP: Invalid address family %i (SIOCGIFADDR)",
+ paddr->sin_family);
+ iapp_deinit(iapp);
+ return NULL;
+ }
+ iapp->own.s_addr = paddr->sin_addr.s_addr;
+
+ if (ioctl(iapp->udp_sock, SIOCGIFBRDADDR, &ifr) != 0) {
+ wpa_printf(MSG_INFO, "iapp_init - ioctl(SIOCGIFBRDADDR): %s",
+ strerror(errno));
+ iapp_deinit(iapp);
+ return NULL;
+ }
+ paddr = (struct sockaddr_in *) &ifr.ifr_addr;
+ if (paddr->sin_family != AF_INET) {
+ wpa_printf(MSG_INFO, "Invalid address family %i (SIOCGIFBRDADDR)",
+ paddr->sin_family);
+ iapp_deinit(iapp);
+ return NULL;
+ }
+ inet_aton(IAPP_MULTICAST, &iapp->multicast);
+
+ os_memset(&uaddr, 0, sizeof(uaddr));
+ uaddr.sin_family = AF_INET;
+ uaddr.sin_port = htons(IAPP_UDP_PORT);
+
+ if (setsockopt(iapp->udp_sock, SOL_SOCKET, SO_REUSEADDR, &reuseaddr,
+ sizeof(reuseaddr)) < 0) {
+ wpa_printf(MSG_INFO,
+ "iapp_init - setsockopt[UDP,SO_REUSEADDR]: %s",
+ strerror(errno));
+ /*
+ * Ignore this and try to continue. This is fine for single
+ * BSS cases, but may fail if multiple BSSes enable IAPP.
+ */
+ }
+
+ if (bind(iapp->udp_sock, (struct sockaddr *) &uaddr,
+ sizeof(uaddr)) < 0) {
+ wpa_printf(MSG_INFO, "iapp_init - bind[UDP]: %s",
+ strerror(errno));
+ iapp_deinit(iapp);
+ return NULL;
+ }
+
+ os_memset(&mreq, 0, sizeof(mreq));
+ mreq.imr_multiaddr = iapp->multicast;
+ mreq.imr_address.s_addr = INADDR_ANY;
+ mreq.imr_ifindex = 0;
+ if (setsockopt(iapp->udp_sock, SOL_IP, IP_ADD_MEMBERSHIP, &mreq,
+ sizeof(mreq)) < 0) {
+ wpa_printf(MSG_INFO, "iapp_init - setsockopt[UDP,IP_ADD_MEMBERSHIP]: %s",
+ strerror(errno));
+ iapp_deinit(iapp);
+ return NULL;
+ }
+
+ iapp->packet_sock = socket(PF_PACKET, SOCK_RAW, htons(ETH_P_ALL));
+ if (iapp->packet_sock < 0) {
+ wpa_printf(MSG_INFO, "iapp_init - socket[PF_PACKET,SOCK_RAW]: %s",
+ strerror(errno));
+ iapp_deinit(iapp);
+ return NULL;
+ }
+
+ os_memset(&addr, 0, sizeof(addr));
+ addr.sll_family = AF_PACKET;
+ addr.sll_ifindex = ifindex;
+ if (bind(iapp->packet_sock, (struct sockaddr *) &addr,
+ sizeof(addr)) < 0) {
+ wpa_printf(MSG_INFO, "iapp_init - bind[PACKET]: %s",
+ strerror(errno));
+ iapp_deinit(iapp);
+ return NULL;
+ }
+
+ if (eloop_register_read_sock(iapp->udp_sock, iapp_receive_udp,
+ iapp, NULL)) {
+ wpa_printf(MSG_INFO, "Could not register read socket for IAPP");
+ iapp_deinit(iapp);
+ return NULL;
+ }
+
+ wpa_printf(MSG_INFO, "IEEE 802.11F (IAPP) using interface %s", iface);
+
+ /* TODO: For levels 2 and 3: send RADIUS Initiate-Request, receive
+ * RADIUS Initiate-Accept or Initiate-Reject. IAPP port should actually
+ * be openned only after receiving Initiate-Accept. If Initiate-Reject
+ * is received, IAPP is not started. */
+
+ return iapp;
+}
+
+
+void iapp_deinit(struct iapp_data *iapp)
+{
+ struct ip_mreqn mreq;
+
+ if (iapp == NULL)
+ return;
+
+ if (iapp->udp_sock >= 0) {
+ os_memset(&mreq, 0, sizeof(mreq));
+ mreq.imr_multiaddr = iapp->multicast;
+ mreq.imr_address.s_addr = INADDR_ANY;
+ mreq.imr_ifindex = 0;
+ if (setsockopt(iapp->udp_sock, SOL_IP, IP_DROP_MEMBERSHIP,
+ &mreq, sizeof(mreq)) < 0) {
+ wpa_printf(MSG_INFO, "iapp_deinit - setsockopt[UDP,IP_DEL_MEMBERSHIP]: %s",
+ strerror(errno));
+ }
+
+ eloop_unregister_read_sock(iapp->udp_sock);
+ close(iapp->udp_sock);
+ }
+ if (iapp->packet_sock >= 0) {
+ eloop_unregister_read_sock(iapp->packet_sock);
+ close(iapp->packet_sock);
+ }
+ os_free(iapp);
+}
diff --git a/src/ap/iapp.h b/src/ap/iapp.h
new file mode 100644
index 000000000..c22118342
--- /dev/null
+++ b/src/ap/iapp.h
@@ -0,0 +1,39 @@
+/*
+ * hostapd / IEEE 802.11F-2003 Inter-Access Point Protocol (IAPP)
+ * Copyright (c) 2002-2005, Jouni Malinen <j@w1.fi>
+ *
+ * This software may be distributed under the terms of the BSD license.
+ * See README for more details.
+ */
+
+#ifndef IAPP_H
+#define IAPP_H
+
+struct iapp_data;
+
+#ifdef CONFIG_IAPP
+
+void iapp_new_station(struct iapp_data *iapp, struct sta_info *sta);
+struct iapp_data * iapp_init(struct hostapd_data *hapd, const char *iface);
+void iapp_deinit(struct iapp_data *iapp);
+
+#else /* CONFIG_IAPP */
+
+static inline void iapp_new_station(struct iapp_data *iapp,
+ struct sta_info *sta)
+{
+}
+
+static inline struct iapp_data * iapp_init(struct hostapd_data *hapd,
+ const char *iface)
+{
+ return NULL;
+}
+
+static inline void iapp_deinit(struct iapp_data *iapp)
+{
+}
+
+#endif /* CONFIG_IAPP */
+
+#endif /* IAPP_H */
diff --git a/src/utils/wpa_debug.h b/src/utils/wpa_debug.h
index 824538b41..498b35291 100644
--- a/src/utils/wpa_debug.h
+++ b/src/utils/wpa_debug.h
@@ -354,6 +354,7 @@ void hostapd_logger_register_cb(hostapd_logger_cb_func func);
#define HOSTAPD_MODULE_RADIUS 0x00000004
#define HOSTAPD_MODULE_WPA 0x00000008
#define HOSTAPD_MODULE_DRIVER 0x00000010
+#define HOSTAPD_MODULE_IAPP 0x00000020
#define HOSTAPD_MODULE_MLME 0x00000040
enum hostapd_logger_level {
diff --git a/tests/build/build-hostapd-internal.config b/tests/build/build-hostapd-internal.config
index 421977eed..0fc1c2511 100644
--- a/tests/build/build-hostapd-internal.config
+++ b/tests/build/build-hostapd-internal.config
@@ -79,6 +79,7 @@ CONFIG_MBO=y
CONFIG_CODE_COVERAGE=y
CFLAGS += -O0 -Wsign-compare
+CONFIG_IAPP=y
CONFIG_TAXONOMY=y
#CONFIG_FILS=y
#CONFIG_FILS_SK_PFS=y
diff --git a/tests/hwsim/example-hostapd.config b/tests/hwsim/example-hostapd.config
index 5b7130fdc..451414e01 100644
--- a/tests/hwsim/example-hostapd.config
+++ b/tests/hwsim/example-hostapd.config
@@ -108,6 +108,7 @@ CONFIG_SUITEB=y
#LIBS_c += -fsanitize=undefined
CONFIG_MBO=y
+CONFIG_IAPP=y
CONFIG_TAXONOMY=y
CONFIG_FILS=y
CONFIG_FILS_SK_PFS=y

View File

@ -1,44 +1,47 @@
From ad70cdb2e4caa58b7f90fc56e7ed3cb36f663c0d Mon Sep 17 00:00:00 2001
From b1f03e0b2257ce0e32a0a55a75b1e89e121550ce Mon Sep 17 00:00:00 2001
From: Patrick Walther <patrick.walther@netmodule.com>
Date: Tue, 28 Jan 2020 15:14:35 +0100
Subject: [PATCH] ADD: add wpa_supplicant and hostapd to meta layer
---
src/ap/hostapd.c | 20 +++++++++++++++-----
1 file changed, 15 insertions(+), 5 deletions(-)
diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c
index 7e261209d..21f29ab5b 100644
index ca282aad3..096e9751e 100644
--- a/src/ap/hostapd.c
+++ b/src/ap/hostapd.c
@@ -1424,8 +1424,8 @@ static int hostapd_setup_bss(struct hostapd_data *hapd, int first)
if (conf->ieee802_11f &&
(hapd->iapp = iapp_init(hapd, conf->iapp_iface)) == NULL) {
- wpa_printf(MSG_ERROR, "IEEE 802.11F (IAPP) initialization "
- "failed.");
+ hostapd_logger(hapd, NULL, HOSTAPD_MODULE_IEEE80211,
+ HOSTAPD_LEVEL_DEBUG, "IEEE 802.11F (IAPP) initialization failed. Try again later");
return -1;
@@ -1347,10 +1347,9 @@ static int hostapd_setup_bss(struct hostapd_data *hapd, int first)
}
@@ -3331,6 +3331,19 @@ void hostapd_new_assoc_sta(struct hostapd_data *hapd, struct sta_info *sta,
sta->post_csa_sa_query = 0;
if (conf->ieee802_11f &&
- (hapd->iapp = iapp_init(hapd, conf->iapp_iface)) == NULL) {
- wpa_printf(MSG_ERROR, "IEEE 802.11F (IAPP) initialization "
- "failed.");
- return -1;
+ (hapd->iapp = iapp_init(hapd, hapd->conf->iapp_iface)) == NULL) {
+ hostapd_logger(hapd, NULL, HOSTAPD_MODULE_IEEE80211,
+ HOSTAPD_LEVEL_DEBUG, "IEEE 802.11F (IAPP) initialization failed. Try again later");
}
#ifdef CONFIG_INTERWORKING
@@ -3141,8 +3140,19 @@ void hostapd_new_assoc_sta(struct hostapd_data *hapd, struct sta_info *sta,
ap_sta_clear_disconnect_timeouts(hapd, sta);
/* IEEE 802.11F (IAPP) */
- if (hapd->conf->ieee802_11f)
+ if (hapd->conf->ieee802_11f) {
+ if (!hapd->iapp) {
+ hostapd_logger(hapd, NULL, HOSTAPD_MODULE_IEEE80211,
+ HOSTAPD_LEVEL_DEBUG, "IEEE 802.11F (IAPP) initialization try again");
+ hapd->iapp = iapp_init(hapd, hapd->conf->iapp_iface);
+ }
+ if (hapd->iapp) {
+ hostapd_logger(hapd, NULL, HOSTAPD_MODULE_IEEE80211,
+ HOSTAPD_LEVEL_DEBUG, "IEEE 802.11F (IAPP) initialization add new station");
+ iapp_new_station(hapd->iapp, sta);
+ }
+ }
+
if (hapd->conf->ieee802_11f)
+ if (!hapd->iapp) {
+ hostapd_logger(hapd, NULL, HOSTAPD_MODULE_IEEE80211,
+ HOSTAPD_LEVEL_DEBUG, "IEEE 802.11F (IAPP) initialization try again");
+ hapd->iapp = iapp_init(hapd, hapd->conf->iapp_iface);
+ }
+ if (hapd->iapp) {
+ hostapd_logger(hapd, NULL, HOSTAPD_MODULE_IEEE80211,
+ HOSTAPD_LEVEL_DEBUG, "IEEE 802.11F (IAPP) initialization add new station");
iapp_new_station(hapd->iapp, sta);
+ }
+ }
+
#ifdef CONFIG_P2P
if (sta->p2p_ie == NULL && !sta->no_p2p_set) {

View File

@ -8,37 +8,27 @@ Date: Tue, 28 Jan 2020 15:14:35 +0100
2 files changed, 3 insertions(+)
diff --git a/src/drivers/driver_nl80211_capa.c b/src/drivers/driver_nl80211_capa.c
index a0803bad0..2aeb4d984 100644
index 0defd6c7b..698b7f329 100644
--- a/src/drivers/driver_nl80211_capa.c
+++ b/src/drivers/driver_nl80211_capa.c
@@ -1578,6 +1578,9 @@ static void phy_info_freq(struct hostapd_hw_modes *mode,
@@ -1371,6 +1371,8 @@ static void phy_info_freq(struct hostapd_hw_modes *mode,
chan->flag |= HOSTAPD_CHAN_INDOOR_ONLY;
if (tb_freq[NL80211_FREQUENCY_ATTR_GO_CONCURRENT])
chan->flag |= HOSTAPD_CHAN_GO_CONCURRENT;
+ if (tb_freq[NL80211_FREQUENCY_ATTR_SRD_CHANNEL])
+ if (tb_freq[NL80211_FREQUENCY_ATTR_SRD_CHANNEL])
+ chan->flag |= HOSTAPD_CHAN_DISABLED;
+
if (tb_freq[NL80211_FREQUENCY_ATTR_NO_10MHZ])
chan->allowed_bw &= ~HOSTAPD_CHAN_WIDTH_10;
if (tb_freq[NL80211_FREQUENCY_ATTR_NO_20MHZ])
diff --git a/src/drivers/nl80211_copy.h b/src/drivers/nl80211_copy.h
index 0568a7909..1d5bbab23 100644
index 6f09d1500..52413aabb 100644
--- a/src/drivers/nl80211_copy.h
+++ b/src/drivers/nl80211_copy.h
@@ -4009,6 +4009,8 @@ enum nl80211_wmm_rule {
* as the primary or any of the secondary channels isn't possible
* @NL80211_FREQUENCY_ATTR_NO_EHT: EHT operation is not allowed on this channel
* in current regulatory domain.
+ * @NL80211_FREQUENCY_ATTR_SRD_CHANNEL: short range devices mode
+ * on this channel in current regulatory domain.
* @NL80211_FREQUENCY_ATTR_MAX: highest frequency attribute number
* currently defined
* @__NL80211_FREQUENCY_ATTR_AFTER_LAST: internal use
@@ -4047,6 +4049,7 @@ enum nl80211_frequency_attr {
NL80211_FREQUENCY_ATTR_16MHZ,
NL80211_FREQUENCY_ATTR_NO_320MHZ,
NL80211_FREQUENCY_ATTR_NO_EHT,
+ NL80211_FREQUENCY_ATTR_SRD_CHANNEL,
@@ -3530,6 +3530,7 @@ enum nl80211_frequency_attr {
NL80211_FREQUENCY_ATTR_NO_20MHZ,
NL80211_FREQUENCY_ATTR_NO_10MHZ,
NL80211_FREQUENCY_ATTR_WMM,
+ NL80211_FREQUENCY_ATTR_SRD_CHANNEL,
/* keep last */
__NL80211_FREQUENCY_ATTR_AFTER_LAST,

View File

@ -1,38 +0,0 @@
From f0e9f5aab52b3eab85d28338cc996972ced4c39c Mon Sep 17 00:00:00 2001
From: David Bauer <mail@david-bauer.net>
Date: Tue, 17 May 2022 23:07:59 +0200
Subject: [PATCH] ctrl: make WNM_AP functions dependant on CONFIG_AP
This fixes linking errors found when compiling wpa_supplicant with
CONFIG_WNM_AP enabled but CONFIG_AP disabled.
Signed-off-by: David Bauer <mail@david-bauer.net>
---
wpa_supplicant/ctrl_iface.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/wpa_supplicant/ctrl_iface.c b/wpa_supplicant/ctrl_iface.c
index ac337e0f5..6e23114e6 100644
--- a/wpa_supplicant/ctrl_iface.c
+++ b/wpa_supplicant/ctrl_iface.c
@@ -12185,7 +12185,7 @@ char * wpa_supplicant_ctrl_iface_process(struct wpa_supplicant *wpa_s,
if (wpas_ctrl_iface_coloc_intf_report(wpa_s, buf + 18))
reply_len = -1;
#endif /* CONFIG_WNM */
-#ifdef CONFIG_WNM_AP
+#if defined(CONFIG_AP) && defined(CONFIG_WNM_AP)
} else if (os_strncmp(buf, "DISASSOC_IMMINENT ", 18) == 0) {
if (ap_ctrl_iface_disassoc_imminent(wpa_s, buf + 18))
reply_len = -1;
@@ -12195,7 +12195,7 @@ char * wpa_supplicant_ctrl_iface_process(struct wpa_supplicant *wpa_s,
} else if (os_strncmp(buf, "BSS_TM_REQ ", 11) == 0) {
if (ap_ctrl_iface_bss_tm_req(wpa_s, buf + 11))
reply_len = -1;
-#endif /* CONFIG_WNM_AP */
+#endif /* CONFIG_AP && CONFIG_WNM_AP */
} else if (os_strcmp(buf, "FLUSH") == 0) {
wpa_supplicant_ctrl_iface_flush(wpa_s);
} else if (os_strncmp(buf, "RADIO_WORK ", 11) == 0) {
--
2.35.1

View File

@ -1,19 +0,0 @@
--- a/wpa_supplicant/wpa_supplicant.c
+++ b/wpa_supplicant/wpa_supplicant.c
@@ -8104,6 +8104,7 @@ int wpas_network_disabled(struct wpa_sup
!ssid->mem_only_psk)
return 1;
+#ifdef CONFIG_IEEE8021X_EAPOL
#ifdef CRYPTO_RSA_OAEP_SHA256
if (ssid->eap.imsi_privacy_cert) {
struct crypto_rsa_key *key;
@@ -8121,7 +8122,7 @@ int wpas_network_disabled(struct wpa_sup
}
}
#endif /* CRYPTO_RSA_OAEP_SHA256 */
-
+#endif /* CONFIG_IEEE8021X_EAPOL */
return 0;
}

View File

@ -1,32 +0,0 @@
From f374d52079111a4340acb6df835f45ac6b5f3f60 Mon Sep 17 00:00:00 2001
From: Andre Heider <a.heider@gmail.com>
Date: Wed, 22 Jun 2022 14:13:55 +0200
Subject: OpenSSL: Include rsa.h for all OpenSSL versions
This fixes the build with OpenSSL 1.1.1:
../src/crypto/crypto_openssl.c: In function 'crypto_rsa_oaep_sha256_decrypt':
../src/crypto/crypto_openssl.c:4404:49: error: 'RSA_PKCS1_OAEP_PADDING' undeclared (first use in this function)
Signed-off-by: Andre Heider <a.heider@gmail.com>
---
src/crypto/crypto_openssl.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/src/crypto/crypto_openssl.c
+++ b/src/crypto/crypto_openssl.c
@@ -16,6 +16,7 @@
#include <openssl/dh.h>
#include <openssl/hmac.h>
#include <openssl/rand.h>
+#include <openssl/rsa.h>
#include <openssl/pem.h>
#ifdef CONFIG_ECC
#include <openssl/ec.h>
@@ -25,7 +26,6 @@
#include <openssl/provider.h>
#include <openssl/core_names.h>
#include <openssl/param_build.h>
-#include <openssl/rsa.h>
#include <openssl/encoder.h>
#include <openssl/decoder.h>
#else /* OpenSSL version >= 3.0 */

View File

@ -34,7 +34,7 @@ CONFIG_DRIVER_NL80211=y
# CONFIG_LIBNL32=y
# Use libnl-tiny
CONFIG_LIBNL_TINY=y
#CONFIG_LIBNL_TINY=y
# Driver interface for FreeBSD net80211 layer (e.g., Atheros driver)
#CONFIG_DRIVER_BSD=y
@ -57,7 +57,7 @@ CONFIG_PEERKEY=y
# IEEE 802.11w (management frame protection)
# Driver support is also needed for IEEE 802.11w.
CONFIG_IEEE80211W=y
#CONFIG_IEEE80211W=y
# Support Operating Channel Validation
#CONFIG_OCV=y
@ -186,7 +186,7 @@ CONFIG_IEEE80211AC=y
#CONFIG_DEBUG_FILE=y
# Send debug messages to syslog instead of stdout
CONFIG_DEBUG_SYSLOG=y
# CONFIG_DEBUG_SYSLOG=y
# Add support for sending all debug messages (regardless of debug verbosity)
# to the Linux kernel tracing facility. This helps debug the entire stack by
@ -386,7 +386,8 @@ CONFIG_ACS=y
#CONFIG_WPA_CLI_EDIT=y
# Opportunistic Wireless Encryption (OWE)
CONFIG_OWE=y
# Experimental implementation of draft-harkins-owe-07.txt
#CONFIG_OWE=y
# Airtime policy support
#CONFIG_AIRTIME_POLICY=y
@ -404,10 +405,3 @@ CONFIG_OWE=y
# leads to the MIB only being compiled in if
# CONFIG_CTRL_IFACE_MIB is enabled.
# CONFIG_CTRL_IFACE_MIB=y
# Simultaneous Authentication of Equals (SAE), WPA3-Personal
CONFIG_SAE=y
# EAP-SUITE-B-192, WPA3-Enterprise
CONFIG_SUITEB192=y
CONFIG_SUITEB=y

File diff suppressed because it is too large Load Diff

View File

@ -19,14 +19,12 @@ struct hostapd_ubus_request {
enum hostapd_ubus_event_type type;
const struct ieee80211_mgmt *mgmt_frame;
const struct ieee802_11_elems *elems;
int ssi_signal; /* dBm */
const struct hostapd_frame_info *frame_info;
const u8 *addr;
};
struct hostapd_iface;
struct hostapd_data;
struct hapd_interfaces;
struct rrm_measurement_beacon_report;
#ifdef UBUS_SUPPORT
@ -43,28 +41,9 @@ void hostapd_ubus_add_iface(struct hostapd_iface *iface);
void hostapd_ubus_free_iface(struct hostapd_iface *iface);
void hostapd_ubus_add_bss(struct hostapd_data *hapd);
void hostapd_ubus_free_bss(struct hostapd_data *hapd);
void hostapd_ubus_add_vlan(struct hostapd_data *hapd, struct hostapd_vlan *vlan);
void hostapd_ubus_remove_vlan(struct hostapd_data *hapd, struct hostapd_vlan *vlan);
int hostapd_ubus_handle_event(struct hostapd_data *hapd, struct hostapd_ubus_request *req);
void hostapd_ubus_handle_link_measurement(struct hostapd_data *hapd, const u8 *data, size_t len);
void hostapd_ubus_notify(struct hostapd_data *hapd, const char *type, const u8 *mac);
void hostapd_ubus_notify_beacon_report(struct hostapd_data *hapd,
const u8 *addr, u8 token, u8 rep_mode,
struct rrm_measurement_beacon_report *rep,
size_t len);
void hostapd_ubus_notify_radar_detected(struct hostapd_iface *iface, int frequency,
int chan_width, int cf1, int cf2);
void hostapd_ubus_notify_bss_transition_response(
struct hostapd_data *hapd, const u8 *addr, u8 dialog_token, u8 status_code,
u8 bss_termination_delay, const u8 *target_bssid,
const u8 *candidate_list, u16 candidate_list_len);
void hostapd_ubus_add(struct hapd_interfaces *interfaces);
void hostapd_ubus_free(struct hapd_interfaces *interfaces);
int hostapd_ubus_notify_bss_transition_query(
struct hostapd_data *hapd, const u8 *addr, u8 dialog_token, u8 reason,
const u8 *candidate_list, u16 candidate_list_len);
#else
@ -86,60 +65,14 @@ static inline void hostapd_ubus_free_bss(struct hostapd_data *hapd)
{
}
static inline void hostapd_ubus_add_vlan(struct hostapd_data *hapd, struct hostapd_vlan *vlan)
{
}
static inline void hostapd_ubus_remove_vlan(struct hostapd_data *hapd, struct hostapd_vlan *vlan)
{
}
static inline int hostapd_ubus_handle_event(struct hostapd_data *hapd, struct hostapd_ubus_request *req)
{
return 0;
}
static inline void hostapd_ubus_handle_link_measurement(struct hostapd_data *hapd, const u8 *data, size_t len)
{
}
static inline void hostapd_ubus_notify(struct hostapd_data *hapd, const char *type, const u8 *mac)
{
}
static inline void hostapd_ubus_notify_beacon_report(struct hostapd_data *hapd,
const u8 *addr, u8 token,
u8 rep_mode,
struct rrm_measurement_beacon_report *rep,
size_t len)
{
}
static inline void hostapd_ubus_notify_radar_detected(struct hostapd_iface *iface, int frequency,
int chan_width, int cf1, int cf2)
{
}
static inline void hostapd_ubus_notify_bss_transition_response(
struct hostapd_data *hapd, const u8 *addr, u8 dialog_token, u8 status_code,
u8 bss_termination_delay, const u8 *target_bssid,
const u8 *candidate_list, u16 candidate_list_len)
{
}
static inline void hostapd_ubus_add(struct hapd_interfaces *interfaces)
{
}
static inline void hostapd_ubus_free(struct hapd_interfaces *interfaces)
{
}
static inline int hostapd_ubus_notify_bss_transition_query(
struct hostapd_data *hapd, const u8 *addr, u8 dialog_token, u8 reason,
const u8 *candidate_list, u16 candidate_list_len)
{
return 0;
}
#endif
#endif

View File

@ -15,14 +15,14 @@ static inline int has_feature(const char *feat)
if (!strcmp(feat, "11ac"))
return 1;
#endif
#ifdef CONFIG_IEEE80211AX
if (!strcmp(feat, "11ax"))
return 1;
#endif
#ifdef CONFIG_IEEE80211R
if (!strcmp(feat, "11r"))
return 1;
#endif
#ifdef CONFIG_IEEE80211W
if (!strcmp(feat, "11w"))
return 1;
#endif
#ifdef CONFIG_ACS
if (!strcmp(feat, "acs"))
return 1;
@ -38,26 +38,6 @@ static inline int has_feature(const char *feat)
#ifdef CONFIG_SUITEB192
if (!strcmp(feat, "suiteb192"))
return 1;
#endif
#ifdef CONFIG_WEP
if (!strcmp(feat, "wep"))
return 1;
#endif
#ifdef CONFIG_HS20
if (!strcmp(feat, "hs20"))
return 1;
#endif
#ifdef CONFIG_WPS
if (!strcmp(feat, "wps"))
return 1;
#endif
#ifdef CONFIG_FILS
if (!strcmp(feat, "fils"))
return 1;
#endif
#ifdef CONFIG_OCV
if (!strcmp(feat, "ocv"))
return 1;
#endif
return 0;
}

View File

@ -50,7 +50,7 @@ CONFIG_DRIVER_NL80211=y
# CONFIG_LIBNL32=y
# Use libnl-tiny
CONFIG_LIBNL_TINY=y
#CONFIG_LIBNL_TINY=y
# Driver interface for FreeBSD net80211 layer (e.g., Atheros driver)
#CONFIG_DRIVER_BSD=y
@ -253,10 +253,6 @@ CONFIG_CTRL_IFACE=y
# Simultaneous Authentication of Equals (SAE), WPA3-Personal
CONFIG_SAE=y
# EAP-SUITE-B-192, WPA3-Enterprise
CONFIG_SUITEB192=y
CONFIG_SUITEB=y
# Disable scan result processing (ap_mode=1) to save code size by about 1 kB.
# This can be used if ap_scan=1 mode is never enabled.
#CONFIG_NO_SCAN_PROCESSING=y
@ -618,7 +614,8 @@ CONFIG_BGSCAN_SIMPLE=y
#CONFIG_BGSCAN_LEARN=y
# Opportunistic Wireless Encryption (OWE)
CONFIG_OWE=y
# Experimental implementation of draft-harkins-owe-07.txt
#CONFIG_OWE=y
# Device Provisioning Protocol (DPP)
# This requires CONFIG_IEEE80211W=y to be enabled, too. (see

View File

@ -2,10 +2,12 @@ HOMEPAGE = "http://w1.fi/${PN}/"
BUGTRACKER = "http://w1.fi/security/"
SECTION = "network"
LICENSE = "BSD"
LIC_FILES_CHKSUM = "file://COPYING;md5=5ebcb90236d1ad640558c3d3cd3035df \
file://README;beginline=1;endline=56;md5=e3d2f6c2948991e37c1ca4960de84747 \
file://wpa_supplicant/wpa_supplicant.c;beginline=1;endline=12;md5=76306a95306fee9a976b0ac1be70f705"
DEPENDS = "libnl-tiny"
LIC_FILES_CHKSUM = "file://COPYING;md5=279b4f5abb9c153c285221855ddb78cc \
file://README;beginline=1;endline=56;md5=e7d3dbb01f75f0b9799e192731d1e1ff \
file://wpa_supplicant/wpa_supplicant.c;beginline=1;endline=12;md5=0a8b56d3543498b742b9c0e94cc2d18b"
DEPENDS = "libnl dbus"
PACKAGECONFIG ??= "gnutls"
PACKAGECONFIG[gnutls] = ",,gnutls libgcrypt"
PACKAGECONFIG[openssl] = ",,openssl"
@ -14,74 +16,64 @@ inherit pkgconfig
PACKAGECONFIG = "openssl"
SRC_URI = "git://w1.fi/hostap.git;protocol=http;branch=main \
file://wpa_supplicant-full.config \
file://hostapd-full.config \
file://src/utils/build_features.h \
file://0001-Add-build-artifact-build_features.h-to-gitignore.patch \
file://0002-Use-environment-variable-EXTRA_CFLAGS.patch \
file://001-wolfssl-init-RNG-with-ECC-key.patch \
file://010-mesh-Allow-DFS-channels-to-be-selected-if-dfs-is-ena.patch \
file://011-mesh-use-deterministic-channel-on-channel-switch.patch \
file://021-fix-sta-add-after-previous-connection.patch \
file://022-hostapd-fix-use-of-uninitialized-stack-variables.patch \
file://023-ndisc_snoop-call-dl_list_del-before-freeing-ipv6-add.patch \
file://030-driver_nl80211-rewrite-neigh-code-to-not-depend-on-l.patch \
file://040-mesh-allow-processing-authentication-frames-in-block.patch \
file://050-build_fix.patch \
file://100-daemonize_fix.patch \
file://200-multicall.patch \
file://300-noscan.patch \
file://301-mesh-noscan.patch \
file://310-rescan_immediately.patch \
file://320-optional_rfkill.patch \
file://330-nl80211_fix_set_freq.patch \
file://340-reload_freq_change.patch \
file://341-mesh-ctrl-iface-channel-switch.patch \
file://350-nl80211_del_beacon_bss.patch \
file://360-ctrl_iface_reload.patch \
file://370-ap_sta_support.patch \
file://380-disable_ctrl_iface_mib.patch \
file://381-hostapd_cli_UNKNOWN-COMMAND.patch \
file://390-wpa_ie_cap_workaround.patch \
file://400-wps_single_auth_enc_type.patch \
file://410-limit_debug_messages.patch \
file://420-indicate-features.patch \
file://430-hostapd_cli_ifdef.patch \
file://431-wpa_cli_ifdef.patch \
file://432-missing-typedef.patch \
file://450-scan_wait.patch \
file://460-wpa_supplicant-add-new-config-params-to-be-used-with.patch \
file://461-driver_nl80211-use-new-parameters-during-ibss-join.patch \
file://463-add-mcast_rate-to-11s.patch \
file://464-fix-mesh-obss-check.patch \
file://465-hostapd-config-support-random-BSS-color.patch \
file://470-survey_data_fallback.patch \
file://500-lto-jobserver-support.patch \
file://590-rrm-wnm-statistics.patch \
file://599-wpa_supplicant-fix-warnings.patch \
file://610-hostapd_cli_ujail_permission.patch \
file://700-wifi-reload.patch \
file://710-vlan_no_bridge.patch \
file://711-wds_bridge_force.patch \
file://720-iface_max_num_sta.patch \
file://730-ft_iface.patch \
file://740-snoop_iface.patch \
file://750-qos_map_set_without_interworking.patch \
file://751-qos_map_ignore_when_unsupported.patch \
file://910-wpa_supplicant_remove_acl.patch \
file://912-iapp-integration.patch \
file://913-iapp-improvements.patch \
file://914-wlan-acs-srd-channels.patch \
file://990-ctrl-make-WNM_AP-functions-dependant-on-CONFIG_AP.patch \
file://991-fix-compile.patch \
file://992-openssl-include-rsa.patch \
file://0001-fix-create-a-versioned-shared-library-libwlan_client.patch \
file://0001-use-nas-port-type-ethernet-for-wired-802.1X.patch \
"
SRC_URI = "git://w1.fi/hostap.git;protocol=http \
file://004-mesh-use-setup-completion-callback-to-complete-mesh-.patch \
file://005-mesh-update-ssid-frequency-as-pri-sec-channel-switch.patch \
file://006-mesh-inform-kernel-driver-DFS-handler-in-userspace.patch \
file://007-mesh-apply-channel-attributes-before-running-Mesh.patch \
file://011-mesh-Allow-DFS-channels-to-be-selected-if-dfs-is-ena.patch \
file://013-mesh-do-not-allow-pri-sec-channel-switch.patch \
file://015-mesh-do-not-use-offchan-mgmt-tx-on-DFS.patch \
file://016-mesh-fix-channel-switch-error-during-CAC.patch \
file://018-mesh-make-forwarding-configurable.patch \
file://051-wpa_supplicant-fix-race-condition-in-mesh-mpm-new-pe.patch \
file://067-0001-AP-Silently-ignore-management-frame-from-unexpected-.patch \
file://070-driver_nl80211-fix-WMM-queue-mapping-for-regulatory-.patch \
file://071-driver_nl80211-fix-regulatory-limits-for-wmm-cwmin-c.patch \
file://090-wolfssl-fix-crypto_bignum_sum.patch \
file://100-daemonize_fix.patch \
file://200-multicall.patch \
file://300-noscan.patch \
file://301-mesh-noscan.patch \
file://310-rescan_immediately.patch \
file://320-optional_rfkill.patch \
file://330-nl80211_fix_set_freq.patch \
file://340-reload_freq_change.patch \
file://341-mesh-ctrl-iface-channel-switch.patch \
file://350-nl80211_del_beacon_bss.patch \
file://360-ctrl_iface_reload.patch \
file://370-ap_sta_support.patch \
file://380-disable_ctrl_iface_mib.patch \
file://381-hostapd_cli_UNKNOWN-COMMAND.patch \
file://390-wpa_ie_cap_workaround.patch \
file://400-wps_single_auth_enc_type.patch \
file://410-limit_debug_messages.patch \
file://420-indicate-features.patch \
file://430-hostapd_cli_ifdef.patch \
file://431-wpa_cli_ifdef.patch \
file://432-missing-typedef.patch \
file://450-scan_wait.patch \
file://460-wpa_supplicant-add-new-config-params-to-be-used-with.patch \
file://461-driver_nl80211-use-new-parameters-during-ibss-join.patch \
file://463-add-mcast_rate-to-11s.patch \
file://464-fix-mesh-obss-check.patch \
file://470-survey_data_fallback.patch \
file://500-lto-jobserver-support.patch \
file://599-wpa_supplicant-fix-warnings.patch \
file://700-wifi-reload.patch \
file://800-usleep.patch \
file://914-wlan-acs-srd-channels.patch \
file://913-iapp-improvements.patch \
file://src/utils/build_features.h \
file://0001-Add-build-artifact-build_features.h-to-gitignore.patch \
file://0002-Use-environment-variable-EXTRA_CFLAGS.patch \
file://wpa_supplicant-full.config \
file://hostapd-full.config \
"
SRCREV = "4383528e01955d995d3b3db201e4c0f9840e8236"
SRC_URI[sha256sum] = "a1330574a241200188ff1478df25b58630012d7db91dfe092b8e0a3c50805ef0"
SRCREV = "ca8c2bd28ad53f431d6ee60ef754e98cfdb4c17b"
SRC_URI[md5sum] = "a68538fb62766f40f890125026c42c10"
SRC_URI[sha256sum] = "9d9f1c60afa5324ee17219bd3ec61c1a6fa4043b4187da9bb44e59025d3ed31d"
CVE_PRODUCT = "${TARGET_NAME}"
CONFFILES_${TARGET_NAME} += "${sysconfdir}/${TARGET_NAME}-full.config"
@ -90,16 +82,10 @@ S = "${WORKDIR}/git"
export EXTRA_CFLAGS = " \
${CFLAGS} \
-I${STAGING_DIR_TARGET}/usr/include/libnl-tiny \
-lnl-tiny \
-DCONFIG_LIBNL20 \
-DCONFIG_LIBNL_TINY \
-D_GNU_SOURCE \
-I${STAGING_DIR_TARGET}/usr/include/libnl3 \
"
LDFLAGS += " -Wl,--gc-sections"
EXTRA_OEMAKE_append = " WPAPV=${PV}.0"
export BINDIR = "${sbindir}"
do_configure () {

View File

@ -1,27 +0,0 @@
SUMMARY = "A library for using the hostapd/wpa_supplicant control interface"
# This is part of wpa_supplicant and defined in the wpa_supplicant Makefile
TARGET_NAME = "wpa_supplicant"
include hostapd.inc
#PACKAGES_prepend = "libwpa_client"
FILES_${PN} += "${libdir}/*.so"
RPROVIDES_${PN} = "libwpa_client.so"
PROVIDES = "libwpa_client.so"
do_install () {
install -d ${D}${libdir}
install -d ${D}${includedir}/wpa_client
install -m 755 wpa_supplicant/libwpa_client.so ${D}${libdir}/libwpa_client.so.2.10.0
install -m 644 src/common/wpa_ctrl.h ${D}${includedir}/wpa_client
ln -sf libwpa_client.so.2.10.0 ${D}${libdir}/libwpa_client.so
}
do_compile () {
unset CFLAGS CPPFLAGS CXXFLAGS
oe_runmake -C ${TARGET_NAME} libwpa_client.so
}

View File

@ -1,12 +1,22 @@
From 13b43a00f498abca2832701e8e343cb0ffa15c70 Mon Sep 17 00:00:00 2001
From: Moritz Rosenthal <moritz.rosenthal@netmodule.com>
Date: Sat, 29 Feb 2020 18:26:04 +0100
Subject: [PATCH] Remove obsolete library
Not needed if we use libnl-tiny
---
Makefile | 1 -
1 file changed, 1 deletion(-)
diff --git a/Makefile b/Makefile
index 2fb8db8..0ad1f42 100644
index c0560d8..25a40cf 100644
--- a/Makefile
+++ b/Makefile
@@ -46,7 +46,6 @@ endif
@@ -63,7 +63,6 @@ endif
ifeq ($(NL2FOUND),Y)
override CFLAGS += -DCONFIG_LIBNL20
-override LIBS += -lnl-genl
CFLAGS += -DCONFIG_LIBNL20
-LIBS += -lnl-genl
NLLIBNAME = libnl-2.0
endif

View File

@ -1,554 +1,41 @@
--- a/nl80211.h
+++ b/nl80211.h
@@ -11,7 +11,7 @@
* Copyright 2008 Jouni Malinen <jouni.malinen@atheros.com>
* Copyright 2008 Colin McCabe <colin@cozybit.com>
* Copyright 2015-2017 Intel Deutschland GmbH
- * Copyright (C) 2018-2022 Intel Corporation
+ * Copyright (C) 2018-2021 Intel Corporation
@@ -2373,6 +2373,9 @@ enum nl80211_commands {
* the allowed channel bandwidth configurations. (u8 attribute)
* Defined by IEEE P802.11ay/D4.0 section 9.4.2.251, Table 13.
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
@@ -301,29 +301,6 @@
*/
/**
- * DOC: FILS shared key crypto offload
- *
- * This feature is applicable to drivers running in AP mode.
- *
- * FILS shared key crypto offload can be advertised by drivers by setting
- * @NL80211_EXT_FEATURE_FILS_CRYPTO_OFFLOAD flag. The drivers that support
- * FILS shared key crypto offload should be able to encrypt and decrypt
- * association frames for FILS shared key authentication as per IEEE 802.11ai.
- * With this capability, for FILS key derivation, drivers depend on userspace.
- *
- * After FILS key derivation, userspace shares the FILS AAD details with the
- * driver and the driver stores the same to use in decryption of association
- * request and in encryption of association response. The below parameters
- * should be given to the driver in %NL80211_CMD_SET_FILS_AAD.
- * %NL80211_ATTR_MAC - STA MAC address, used for storing FILS AAD per STA
- * %NL80211_ATTR_FILS_KEK - Used for encryption or decryption
- * %NL80211_ATTR_FILS_NONCES - Used for encryption or decryption
- * (STA Nonce 16 bytes followed by AP Nonce 16 bytes)
- *
- * Once the association is done, the driver cleans the FILS AAD data.
- */
-
-/**
* enum nl80211_commands - supported nl80211 commands
*
* @NL80211_CMD_UNSPEC: unspecified command to catch errors
@@ -1226,17 +1203,6 @@
* @NL80211_CMD_COLOR_CHANGE_COMPLETED: Notify userland that the color change
* has completed
*
- * @NL80211_CMD_SET_FILS_AAD: Set FILS AAD data to the driver using -
- * &NL80211_ATTR_MAC - for STA MAC address
- * &NL80211_ATTR_FILS_KEK - for KEK
- * &NL80211_ATTR_FILS_NONCES - for FILS Nonces
- * (STA Nonce 16 bytes followed by AP Nonce 16 bytes)
- *
- * @NL80211_CMD_ASSOC_COMEBACK: notification about an association
- * temporal rejection with comeback. The event includes %NL80211_ATTR_MAC
- * to describe the BSSID address of the AP and %NL80211_ATTR_TIMEOUT to
- * specify the timeout value.
- *
* @NL80211_CMD_MAX: highest used command number
* @__NL80211_CMD_AFTER_LAST: internal use
*/
@@ -1477,10 +1443,6 @@ enum nl80211_commands {
NL80211_CMD_COLOR_CHANGE_ABORTED,
NL80211_CMD_COLOR_CHANGE_COMPLETED,
- NL80211_CMD_SET_FILS_AAD,
-
- NL80211_CMD_ASSOC_COMEBACK,
-
/* add new commands above here */
/* used to define NL80211_CMD_MAX below */
@@ -2477,9 +2439,7 @@ enum nl80211_commands {
* space supports external authentication. This attribute shall be used
* with %NL80211_CMD_CONNECT and %NL80211_CMD_START_AP request. The driver
* may offload authentication processing to user space if this capability
- * is indicated in the respective requests from the user space. (This flag
- * attribute deprecated for %NL80211_CMD_START_AP, use
- * %NL80211_ATTR_AP_SETTINGS_FLAGS)
+ * is indicated in the respective requests from the user space.
*
* @NL80211_ATTR_NSS: Station's New/updated RX_NSS value notified using this
* u8 attribute. This is used with %NL80211_CMD_STA_OPMODE_CHANGED.
@@ -2655,13 +2615,8 @@ enum nl80211_commands {
* switching on a different channel during CAC detection on the selected
* radar channel.
*
- * @NL80211_ATTR_AP_SETTINGS_FLAGS: u32 attribute contains ap settings flags,
- * enumerated in &enum nl80211_ap_settings_flags. This attribute shall be
- * used with %NL80211_CMD_START_AP request.
- *
- * @NL80211_ATTR_EHT_CAPABILITY: EHT Capability information element (from
- * association request when used with NL80211_CMD_NEW_STATION). Can be set
- * only if %NL80211_STA_FLAG_WME is set.
+ * @NL80211_ATTR_WIPHY_ANTENNA_GAIN: Configured antenna gain. Used to reduce
+ * transmit power to stay within regulatory limits. u32, dBi.
*
+ *
* @NUM_NL80211_ATTR: total number of nl80211_attrs available
* @NL80211_ATTR_MAX: highest attribute number currently defined
@@ -3171,11 +3126,7 @@ enum nl80211_attrs {
* @__NL80211_ATTR_AFTER_LAST: internal use
@@ -2835,6 +2838,8 @@ enum nl80211_attrs {
NL80211_ATTR_WIPHY_EDMG_CHANNELS,
NL80211_ATTR_WIPHY_EDMG_BW_CONFIG,
NL80211_ATTR_RADAR_BACKGROUND,
- NL80211_ATTR_AP_SETTINGS_FLAGS,
-
- NL80211_ATTR_EHT_CAPABILITY,
-
- NL80211_ATTR_DISABLE_EHT,
+ NL80211_ATTR_WIPHY_ANTENNA_GAIN,
+
/* add attributes here, update the policy in nl80211.c */
@@ -3232,8 +3183,6 @@ enum nl80211_attrs {
#define NL80211_HE_MAX_CAPABILITY_LEN 54
#define NL80211_MAX_NR_CIPHER_SUITES 5
#define NL80211_MAX_NR_AKM_SUITES 2
-#define NL80211_EHT_MIN_CAPABILITY_LEN 13
-#define NL80211_EHT_MAX_CAPABILITY_LEN 51
#define NL80211_MIN_REMAIN_ON_CHANNEL_TIME 10
@@ -3261,7 +3210,7 @@ enum nl80211_attrs {
* and therefore can't be created in the normal ways, use the
* %NL80211_CMD_START_P2P_DEVICE and %NL80211_CMD_STOP_P2P_DEVICE
* commands to create and destroy one
- * @NL80211_IFTYPE_OCB: Outside Context of a BSS
+ * @NL80211_IF_TYPE_OCB: Outside Context of a BSS
* This mode corresponds to the MIB variable dot11OCBActivated=true
* @NL80211_IFTYPE_NAN: NAN device interface type (not a netdev)
* @NL80211_IFTYPE_MAX: highest interface type number currently defined
@@ -3403,56 +3352,6 @@ enum nl80211_he_ru_alloc {
};
/**
- * enum nl80211_eht_gi - EHT guard interval
- * @NL80211_RATE_INFO_EHT_GI_0_8: 0.8 usec
- * @NL80211_RATE_INFO_EHT_GI_1_6: 1.6 usec
- * @NL80211_RATE_INFO_EHT_GI_3_2: 3.2 usec
- */
-enum nl80211_eht_gi {
- NL80211_RATE_INFO_EHT_GI_0_8,
- NL80211_RATE_INFO_EHT_GI_1_6,
- NL80211_RATE_INFO_EHT_GI_3_2,
-};
-
-/**
- * enum nl80211_eht_ru_alloc - EHT RU allocation values
- * @NL80211_RATE_INFO_EHT_RU_ALLOC_26: 26-tone RU allocation
- * @NL80211_RATE_INFO_EHT_RU_ALLOC_52: 52-tone RU allocation
- * @NL80211_RATE_INFO_EHT_RU_ALLOC_52P26: 52+26-tone RU allocation
- * @NL80211_RATE_INFO_EHT_RU_ALLOC_106: 106-tone RU allocation
- * @NL80211_RATE_INFO_EHT_RU_ALLOC_106P26: 106+26 tone RU allocation
- * @NL80211_RATE_INFO_EHT_RU_ALLOC_242: 242-tone RU allocation
- * @NL80211_RATE_INFO_EHT_RU_ALLOC_484: 484-tone RU allocation
- * @NL80211_RATE_INFO_EHT_RU_ALLOC_484P242: 484+242 tone RU allocation
- * @NL80211_RATE_INFO_EHT_RU_ALLOC_996: 996-tone RU allocation
- * @NL80211_RATE_INFO_EHT_RU_ALLOC_996P484: 996+484 tone RU allocation
- * @NL80211_RATE_INFO_EHT_RU_ALLOC_996P484P242: 996+484+242 tone RU allocation
- * @NL80211_RATE_INFO_EHT_RU_ALLOC_2x996: 2x996-tone RU allocation
- * @NL80211_RATE_INFO_EHT_RU_ALLOC_2x996P484: 2x996+484 tone RU allocation
- * @NL80211_RATE_INFO_EHT_RU_ALLOC_3x996: 3x996-tone RU allocation
- * @NL80211_RATE_INFO_EHT_RU_ALLOC_3x996P484: 3x996+484 tone RU allocation
- * @NL80211_RATE_INFO_EHT_RU_ALLOC_4x996: 4x996-tone RU allocation
- */
-enum nl80211_eht_ru_alloc {
- NL80211_RATE_INFO_EHT_RU_ALLOC_26,
- NL80211_RATE_INFO_EHT_RU_ALLOC_52,
- NL80211_RATE_INFO_EHT_RU_ALLOC_52P26,
- NL80211_RATE_INFO_EHT_RU_ALLOC_106,
- NL80211_RATE_INFO_EHT_RU_ALLOC_106P26,
- NL80211_RATE_INFO_EHT_RU_ALLOC_242,
- NL80211_RATE_INFO_EHT_RU_ALLOC_484,
- NL80211_RATE_INFO_EHT_RU_ALLOC_484P242,
- NL80211_RATE_INFO_EHT_RU_ALLOC_996,
- NL80211_RATE_INFO_EHT_RU_ALLOC_996P484,
- NL80211_RATE_INFO_EHT_RU_ALLOC_996P484P242,
- NL80211_RATE_INFO_EHT_RU_ALLOC_2x996,
- NL80211_RATE_INFO_EHT_RU_ALLOC_2x996P484,
- NL80211_RATE_INFO_EHT_RU_ALLOC_3x996,
- NL80211_RATE_INFO_EHT_RU_ALLOC_3x996P484,
- NL80211_RATE_INFO_EHT_RU_ALLOC_4x996,
-};
-
-/**
* enum nl80211_rate_info - bitrate information
__NL80211_ATTR_AFTER_LAST,
@@ -5484,6 +5489,10 @@ enum nl80211_feature_flags {
* @NL80211_EXT_FEATURE_SAE_OFFLOAD: Device wants to do SAE authentication in
* station mode (SAE password is passed as part of the connect command).
*
* These attribute types are used with %NL80211_STA_INFO_TXRATE
@@ -3491,13 +3390,6 @@ enum nl80211_eht_ru_alloc {
* @NL80211_RATE_INFO_HE_DCM: HE DCM value (u8, 0/1)
* @NL80211_RATE_INFO_RU_ALLOC: HE RU allocation, if not present then
* non-OFDMA was used (u8, see &enum nl80211_he_ru_alloc)
- * @NL80211_RATE_INFO_320_MHZ_WIDTH: 320 MHz bitrate
- * @NL80211_RATE_INFO_EHT_MCS: EHT MCS index (u8, 0-15)
- * @NL80211_RATE_INFO_EHT_NSS: EHT NSS value (u8, 1-8)
- * @NL80211_RATE_INFO_EHT_GI: EHT guard interval identifier
- * (u8, see &enum nl80211_eht_gi)
- * @NL80211_RATE_INFO_EHT_RU_ALLOC: EHT RU allocation, if not present then
- * non-OFDMA was used (u8, see &enum nl80211_eht_ru_alloc)
* @__NL80211_RATE_INFO_AFTER_LAST: internal use
+ * @NL80211_EXT_FEATURE_AQL: The driver supports the Airtime Queue Limit (AQL)
+ * feature, which prevents bufferbloat by using the expected transmission
+ * time to limit the amount of data buffered in the hardware.
+ *
* @NUM_NL80211_EXT_FEATURES: number of extended features.
* @MAX_NL80211_EXT_FEATURES: highest extended feature index.
*/
enum nl80211_rate_info {
@@ -3519,11 +3411,6 @@ enum nl80211_rate_info {
NL80211_RATE_INFO_HE_GI,
NL80211_RATE_INFO_HE_DCM,
NL80211_RATE_INFO_HE_RU_ALLOC,
- NL80211_RATE_INFO_320_MHZ_WIDTH,
- NL80211_RATE_INFO_EHT_MCS,
- NL80211_RATE_INFO_EHT_NSS,
- NL80211_RATE_INFO_EHT_GI,
- NL80211_RATE_INFO_EHT_RU_ALLOC,
/* keep last */
__NL80211_RATE_INFO_AFTER_LAST,
@@ -3834,20 +3721,13 @@ enum nl80211_mpath_info {
* capabilities IE
* @NL80211_BAND_IFTYPE_ATTR_HE_CAP_PPE: HE PPE thresholds information as
* defined in HE capabilities IE
+ * @NL80211_BAND_IFTYPE_ATTR_MAX: highest band HE capability attribute currently
+ * defined
* @NL80211_BAND_IFTYPE_ATTR_HE_6GHZ_CAPA: HE 6GHz band capabilities (__le16),
* given for all 6 GHz band channels
* @NL80211_BAND_IFTYPE_ATTR_VENDOR_ELEMS: vendor element capabilities that are
* advertised on this band/for this iftype (binary)
- * @NL80211_BAND_IFTYPE_ATTR_EHT_CAP_MAC: EHT MAC capabilities as in EHT
- * capabilities element
- * @NL80211_BAND_IFTYPE_ATTR_EHT_CAP_PHY: EHT PHY capabilities as in EHT
- * capabilities element
- * @NL80211_BAND_IFTYPE_ATTR_EHT_CAP_MCS_SET: EHT supported NSS/MCS as in EHT
- * capabilities element
- * @NL80211_BAND_IFTYPE_ATTR_EHT_CAP_PPE: EHT PPE thresholds information as
- * defined in EHT capabilities element
* @__NL80211_BAND_IFTYPE_ATTR_AFTER_LAST: internal use
- * @NL80211_BAND_IFTYPE_ATTR_MAX: highest band attribute currently defined
*/
enum nl80211_band_iftype_attr {
__NL80211_BAND_IFTYPE_ATTR_INVALID,
@@ -3859,10 +3739,6 @@ enum nl80211_band_iftype_attr {
NL80211_BAND_IFTYPE_ATTR_HE_CAP_PPE,
NL80211_BAND_IFTYPE_ATTR_HE_6GHZ_CAPA,
NL80211_BAND_IFTYPE_ATTR_VENDOR_ELEMS,
- NL80211_BAND_IFTYPE_ATTR_EHT_CAP_MAC,
- NL80211_BAND_IFTYPE_ATTR_EHT_CAP_PHY,
- NL80211_BAND_IFTYPE_ATTR_EHT_CAP_MCS_SET,
- NL80211_BAND_IFTYPE_ATTR_EHT_CAP_PPE,
/* keep last */
__NL80211_BAND_IFTYPE_ATTR_AFTER_LAST,
@@ -4007,10 +3883,6 @@ enum nl80211_wmm_rule {
* on this channel in current regulatory domain.
* @NL80211_FREQUENCY_ATTR_16MHZ: 16 MHz operation is allowed
* on this channel in current regulatory domain.
- * @NL80211_FREQUENCY_ATTR_NO_320MHZ: any 320 MHz channel using this channel
- * as the primary or any of the secondary channels isn't possible
- * @NL80211_FREQUENCY_ATTR_NO_EHT: EHT operation is not allowed on this channel
- * in current regulatory domain.
* @NL80211_FREQUENCY_ATTR_MAX: highest frequency attribute number
* currently defined
* @__NL80211_FREQUENCY_ATTR_AFTER_LAST: internal use
@@ -4047,8 +3919,6 @@ enum nl80211_frequency_attr {
NL80211_FREQUENCY_ATTR_4MHZ,
NL80211_FREQUENCY_ATTR_8MHZ,
NL80211_FREQUENCY_ATTR_16MHZ,
- NL80211_FREQUENCY_ATTR_NO_320MHZ,
- NL80211_FREQUENCY_ATTR_NO_EHT,
/* keep last */
__NL80211_FREQUENCY_ATTR_AFTER_LAST,
@@ -4247,7 +4117,6 @@ enum nl80211_sched_scan_match_attr {
* @NL80211_RRF_NO_80MHZ: 80MHz operation not allowed
* @NL80211_RRF_NO_160MHZ: 160MHz operation not allowed
* @NL80211_RRF_NO_HE: HE operation not allowed
- * @NL80211_RRF_NO_320MHZ: 320MHz operation not allowed
*/
enum nl80211_reg_rule_flags {
NL80211_RRF_NO_OFDM = 1<<0,
@@ -4266,7 +4135,6 @@ enum nl80211_reg_rule_flags {
NL80211_RRF_NO_80MHZ = 1<<15,
NL80211_RRF_NO_160MHZ = 1<<16,
NL80211_RRF_NO_HE = 1<<17,
- NL80211_RRF_NO_320MHZ = 1<<18,
};
#define NL80211_RRF_PASSIVE_SCAN NL80211_RRF_NO_IR
@@ -4764,8 +4632,6 @@ enum nl80211_key_mode {
* @NL80211_CHAN_WIDTH_4: 4 MHz OFDM channel
* @NL80211_CHAN_WIDTH_8: 8 MHz OFDM channel
* @NL80211_CHAN_WIDTH_16: 16 MHz OFDM channel
- * @NL80211_CHAN_WIDTH_320: 320 MHz channel, the %NL80211_ATTR_CENTER_FREQ1
- * attribute must be provided as well
*/
enum nl80211_chan_width {
NL80211_CHAN_WIDTH_20_NOHT,
@@ -4781,7 +4647,6 @@ enum nl80211_chan_width {
NL80211_CHAN_WIDTH_4,
NL80211_CHAN_WIDTH_8,
NL80211_CHAN_WIDTH_16,
- NL80211_CHAN_WIDTH_320,
};
/**
@@ -5096,7 +4961,6 @@ enum nl80211_txrate_gi {
* @NL80211_BAND_60GHZ: around 60 GHz band (58.32 - 69.12 GHz)
* @NL80211_BAND_6GHZ: around 6 GHz band (5.9 - 7.2 GHz)
* @NL80211_BAND_S1GHZ: around 900MHz, supported by S1G PHYs
- * @NL80211_BAND_LC: light communication band (placeholder)
* @NUM_NL80211_BANDS: number of bands, avoid using this in userspace
* since newer kernel versions may support more bands
*/
@@ -5106,7 +4970,6 @@ enum nl80211_band {
NL80211_BAND_60GHZ,
NL80211_BAND_6GHZ,
NL80211_BAND_S1GHZ,
- NL80211_BAND_LC,
NUM_NL80211_BANDS,
};
@@ -5673,7 +5536,7 @@ enum nl80211_iface_limit_attrs {
* => allows 8 of AP/GO that can have BI gcd >= min gcd
*
* numbers = [ #{STA} <= 2 ], channels = 2, max = 2
- * => allows two STAs on the same or on different channels
+ * => allows two STAs on different channels
*
* numbers = [ #{STA} <= 1, #{P2P-client,P2P-GO} <= 3 ], max = 4
* => allows a STA plus three P2P interfaces
@@ -5718,7 +5581,7 @@ enum nl80211_if_combination_attrs {
* @NL80211_PLINK_ESTAB: mesh peer link is established
* @NL80211_PLINK_HOLDING: mesh peer link is being closed or cancelled
* @NL80211_PLINK_BLOCKED: all frames transmitted from this mesh
- * plink are discarded, except for authentication frames
+ * plink are discarded
* @NUM_NL80211_PLINK_STATES: number of peer link states
* @MAX_NL80211_PLINK_STATES: highest numerical value of plink states
*/
@@ -5855,15 +5718,13 @@ enum nl80211_tdls_operation {
NL80211_TDLS_DISABLE_LINK,
};
-/**
+/*
* enum nl80211_ap_sme_features - device-integrated AP features
- * @NL80211_AP_SME_SA_QUERY_OFFLOAD: SA Query procedures offloaded to driver
- * when user space indicates support for SA Query procedures offload during
- * "start ap" with %NL80211_AP_SETTINGS_SA_QUERY_OFFLOAD_SUPPORT.
- */
+ * Reserved for future use, no bits are defined in
+ * NL80211_ATTR_DEVICE_AP_SME yet.
enum nl80211_ap_sme_features {
- NL80211_AP_SME_SA_QUERY_OFFLOAD = 1 << 0,
};
+ */
/**
* enum nl80211_feature_flags - device/driver features
@@ -6166,11 +6027,6 @@ enum nl80211_feature_flags {
* @NL80211_EXT_FEATURE_BSS_COLOR: The driver supports BSS color collision
* detection and change announcemnts.
*
- * @NL80211_EXT_FEATURE_FILS_CRYPTO_OFFLOAD: Driver running in AP mode supports
- * FILS encryption and decryption for (Re)Association Request and Response
- * frames. Userspace has to share FILS AAD details to the driver by using
- * @NL80211_CMD_SET_FILS_AAD.
- *
* @NL80211_EXT_FEATURE_RADAR_BACKGROUND: Device supports background radar/CAC
* detection.
*
@@ -6239,7 +6095,6 @@ enum nl80211_ext_feature_index {
NL80211_EXT_FEATURE_SECURE_RTT,
NL80211_EXT_FEATURE_PROT_RANGE_NEGO_AND_MEASURE,
NL80211_EXT_FEATURE_BSS_COLOR,
- NL80211_EXT_FEATURE_FILS_CRYPTO_OFFLOAD,
NL80211_EXT_FEATURE_RADAR_BACKGROUND,
@@ -5529,6 +5538,8 @@ enum nl80211_ext_feature_index {
NL80211_EXT_FEATURE_EXT_KEY_ID,
NL80211_EXT_FEATURE_STA_TX_PWR,
NL80211_EXT_FEATURE_SAE_OFFLOAD,
+ NL80211_EXT_FEATURE_VLAN_OFFLOAD,
+ NL80211_EXT_FEATURE_AQL,
/* add new features before the definition below */
@@ -7548,7 +7403,7 @@ enum nl80211_sar_specs_attrs {
* @NL80211_MBSSID_CONFIG_ATTR_MAX_EMA_PROFILE_PERIODICITY: Used by the kernel
* to advertise the maximum profile periodicity supported by the driver
* if EMA is enabled. Driver should indicate EMA support to the userspace
- * by setting wiphy->ema_max_profile_periodicity to
+ * by setting wiphy->mbssid_max_ema_profile_periodicity to
* a non-zero value.
*
* @NL80211_MBSSID_CONFIG_ATTR_INDEX: Mandatory parameter to pass the index of
@@ -7567,7 +7422,7 @@ enum nl80211_sar_specs_attrs {
*
* @NL80211_MBSSID_CONFIG_ATTR_EMA: Flag used to enable EMA AP feature.
* Setting this flag is permitted only if the driver advertises EMA support
- * by setting wiphy->ema_max_profile_periodicity to non-zero.
+ * by setting wiphy->mbssid_max_ema_profile_periodicity to non-zero.
*
* @__NL80211_MBSSID_CONFIG_ATTR_LAST: Internal
* @NL80211_MBSSID_CONFIG_ATTR_MAX: highest attribute
@@ -7586,20 +7441,4 @@ enum nl80211_mbssid_config_attributes {
NL80211_MBSSID_CONFIG_ATTR_MAX = __NL80211_MBSSID_CONFIG_ATTR_LAST - 1,
};
-/**
- * enum nl80211_ap_settings_flags - AP settings flags
- *
- * @NL80211_AP_SETTINGS_EXTERNAL_AUTH_SUPPORT: AP supports external
- * authentication.
- * @NL80211_AP_SETTINGS_SA_QUERY_OFFLOAD_SUPPORT: Userspace supports SA Query
- * procedures offload to driver. If driver advertises
- * %NL80211_AP_SME_SA_QUERY_OFFLOAD in AP SME features, userspace shall
- * ignore SA Query procedures and validations when this flag is set by
- * userspace.
- */
-enum nl80211_ap_settings_flags {
- NL80211_AP_SETTINGS_EXTERNAL_AUTH_SUPPORT = 1 << 0,
- NL80211_AP_SETTINGS_SA_QUERY_OFFLOAD_SUPPORT = 1 << 1,
-};
-
#endif /* __LINUX_NL80211_H */
--- a/event.c
+++ b/event.c
@@ -1292,9 +1292,6 @@ static int print_event(struct nl_msg *ms
case NL80211_CMD_CH_SWITCH_NOTIFY:
parse_ch_switch_notify(tb, gnlh->cmd);
break;
- case NL80211_CMD_ASSOC_COMEBACK: /* 147 */
- parse_assoc_comeback(tb, gnlh->cmd);
- break;
default:
printf("unknown event %d (%s)\n",
gnlh->cmd, command_name(gnlh->cmd));
--- a/info.c
+++ b/info.c
@@ -164,7 +164,6 @@ static void ext_feat_print(enum nl80211_
ext_feat_case(PROT_RANGE_NEGO_AND_MEASURE,
"support for MFP in range measurement negotiation/procedure");
ext_feat_case(BSS_COLOR, "BSS coloring support");
- ext_feat_case(FILS_CRYPTO_OFFLOAD, "FILS crypto offload");
ext_feat_case(RADAR_BACKGROUND, "Radar background support");
}
}
--- a/interface.c
+++ b/interface.c
@@ -362,8 +362,6 @@ char *channel_width_name(enum nl80211_ch
return "5 MHz";
case NL80211_CHAN_WIDTH_10:
return "10 MHz";
- case NL80211_CHAN_WIDTH_320:
- return "320 MHz";
default:
return "unknown";
}
--- a/util.c
+++ b/util.c
@@ -508,7 +508,6 @@ static int parse_freqs(struct chandef *c
case NL80211_CHAN_WIDTH_40:
case NL80211_CHAN_WIDTH_80:
case NL80211_CHAN_WIDTH_160:
- case NL80211_CHAN_WIDTH_320:
need_cf1 = true;
break;
case NL80211_CHAN_WIDTH_1:
@@ -626,10 +625,6 @@ int parse_freqchan(struct chandef *chand
.width = NL80211_CHAN_WIDTH_160,
.freq1_diff = 0,
.chantype = -1 },
- { .name = "320MHz",
- .width = NL80211_CHAN_WIDTH_320,
- .freq1_diff = 0,
- .chantype = -1 },
};
const struct chanmode *chanmode_selected = NULL;
unsigned int freq;
@@ -1599,48 +1594,6 @@ void print_eht_info(struct nlattr *nl_if
print_iftype_line(tb[NL80211_BAND_IFTYPE_ATTR_IFTYPES]);
printf("\n");
- if (tb[NL80211_BAND_IFTYPE_ATTR_EHT_CAP_MAC]) {
- len = nla_len(tb[NL80211_BAND_IFTYPE_ATTR_EHT_CAP_MAC]);
- if (len > sizeof(mac_cap))
- len = sizeof(mac_cap);
- memcpy(mac_cap,
- nla_data(tb[NL80211_BAND_IFTYPE_ATTR_EHT_CAP_MAC]),
- len);
- }
-
- if (tb[NL80211_BAND_IFTYPE_ATTR_EHT_CAP_PHY]) {
- len = nla_len(tb[NL80211_BAND_IFTYPE_ATTR_EHT_CAP_PHY]);
-
- if (len > sizeof(phy_cap))
- len = sizeof(phy_cap);
-
- memcpy(phy_cap,
- nla_data(tb[NL80211_BAND_IFTYPE_ATTR_EHT_CAP_PHY]),
- len);
- }
-
- if (tb[NL80211_BAND_IFTYPE_ATTR_EHT_CAP_MCS_SET]) {
- len = nla_len(tb[NL80211_BAND_IFTYPE_ATTR_EHT_CAP_MCS_SET]);
- if (len > sizeof(mcs_set))
- len = sizeof(mcs_set);
- memcpy(mcs_set,
- nla_data(tb[NL80211_BAND_IFTYPE_ATTR_EHT_CAP_MCS_SET]),
- len);
-
- // Assume that all parts of the MCS set are present
- mcs_len = sizeof(mcs_set);
- }
-
- if (tb[NL80211_BAND_IFTYPE_ATTR_EHT_CAP_PPE]) {
- len = nla_len(tb[NL80211_BAND_IFTYPE_ATTR_EHT_CAP_PPE]);
- if (len > sizeof(ppet))
- len = sizeof(ppet);
- memcpy(ppet,
- nla_data(tb[NL80211_BAND_IFTYPE_ATTR_EHT_CAP_PPE]),
- len);
- ppet_len = len;
- }
-
if (tb[NL80211_BAND_IFTYPE_ATTR_HE_CAP_PHY]) {
len = nla_len(tb[NL80211_BAND_IFTYPE_ATTR_HE_CAP_PHY]);
--- a/reg.c
+++ b/reg.c
@@ -210,7 +210,6 @@ static int print_reg_handler(struct nl_m
PARSE_FLAG(NL80211_RRF_NO_80MHZ, "NO-80MHZ");
PARSE_FLAG(NL80211_RRF_NO_160MHZ, "NO-160MHZ");
PARSE_FLAG(NL80211_RRF_NO_HE, "NO-HE");
- PARSE_FLAG(NL80211_RRF_NO_320MHZ, "NO-320MHZ");
/* Kernels that support NO_IR always turn on both flags */
if ((flags & NL80211_RRF_NO_IR) && (flags & __NL80211_RRF_NO_IBSS)) {
--- a/station.c
+++ b/station.c
@@ -239,8 +239,6 @@ void parse_bitrate(struct nlattr *bitrat
pos += snprintf(pos, buflen - (pos - buf), " 80P80MHz");
if (rinfo[NL80211_RATE_INFO_160_MHZ_WIDTH])
pos += snprintf(pos, buflen - (pos - buf), " 160MHz");
- if (rinfo[NL80211_RATE_INFO_320_MHZ_WIDTH])
- pos += snprintf(pos, buflen - (pos - buf), " 320MHz");
if (rinfo[NL80211_RATE_INFO_SHORT_GI])
pos += snprintf(pos, buflen - (pos - buf), " short GI");
if (rinfo[NL80211_RATE_INFO_VHT_NSS])
@@ -261,18 +259,6 @@ void parse_bitrate(struct nlattr *bitrat
if (rinfo[NL80211_RATE_INFO_HE_RU_ALLOC])
pos += snprintf(pos, buflen - (pos - buf),
" HE-RU-ALLOC %d", nla_get_u8(rinfo[NL80211_RATE_INFO_HE_RU_ALLOC]));
- if (rinfo[NL80211_RATE_INFO_EHT_MCS])
- pos += snprintf(pos, buflen - (pos - buf),
- " EHT-MCS %d", nla_get_u8(rinfo[NL80211_RATE_INFO_EHT_MCS]));
- if (rinfo[NL80211_RATE_INFO_EHT_NSS])
- pos += snprintf(pos, buflen - (pos - buf),
- " EHT-NSS %d", nla_get_u8(rinfo[NL80211_RATE_INFO_EHT_NSS]));
- if (rinfo[NL80211_RATE_INFO_EHT_GI])
- pos += snprintf(pos, buflen - (pos - buf),
- " EHT-GI %d", nla_get_u8(rinfo[NL80211_RATE_INFO_EHT_GI]));
- if (rinfo[NL80211_RATE_INFO_EHT_RU_ALLOC])
- pos += snprintf(pos, buflen - (pos - buf),
- " EHT-RU-ALLOC %d", nla_get_u8(rinfo[NL80211_RATE_INFO_EHT_RU_ALLOC]));
}
static char *get_chain_signal(struct nlattr *attr_list)
NUM_NL80211_EXT_FEATURES,

View File

@ -1,6 +1,6 @@
--- a/event.c
+++ b/event.c
@@ -971,6 +971,7 @@ static int print_event(struct nl_msg *ms
@@ -699,6 +699,7 @@ static int print_event(struct nl_msg *ms
}
switch (gnlh->cmd) {
@ -8,15 +8,15 @@
case NL80211_CMD_NEW_WIPHY:
printf("renamed to %s\n", nla_get_string(tb[NL80211_ATTR_WIPHY_NAME]));
break;
@@ -1006,6 +1007,7 @@ static int print_event(struct nl_msg *ms
@@ -734,6 +735,7 @@ static int print_event(struct nl_msg *ms
case NL80211_CMD_SCHED_SCAN_RESULTS:
printf("got scheduled scan results\n");
break;
+#endif
case NL80211_CMD_WIPHY_REG_CHANGE:
case NL80211_CMD_REG_CHANGE:
if (gnlh->cmd == NL80211_CMD_WIPHY_REG_CHANGE)
@@ -1088,6 +1090,7 @@ static int print_event(struct nl_msg *ms
printf("regulatory domain change: ");
@@ -812,6 +814,7 @@ static int print_event(struct nl_msg *ms
mac_addr_n2a(macbuf, nla_data(tb[NL80211_ATTR_MAC]));
printf("del station %s\n", macbuf);
break;
@ -24,10 +24,10 @@
case NL80211_CMD_JOIN_IBSS:
mac_addr_n2a(macbuf, nla_data(tb[NL80211_ATTR_MAC]));
printf("IBSS %s joined\n", macbuf);
@@ -1292,9 +1295,9 @@ static int print_event(struct nl_msg *ms
case NL80211_CMD_CH_SWITCH_NOTIFY:
parse_ch_switch_notify(tb, gnlh->cmd);
@@ -989,9 +992,9 @@ static int print_event(struct nl_msg *ms
parse_nan_match(tb);
break;
}
+#endif
default:
- printf("unknown event %d (%s)\n",
@ -38,7 +38,23 @@
--- a/info.c
+++ b/info.c
@@ -308,6 +308,7 @@ next:
@@ -164,6 +164,7 @@ static int print_phy_handler(struct nl_m
tb_band[NL80211_BAND_ATTR_VHT_MCS_SET])
print_vht_info(nla_get_u32(tb_band[NL80211_BAND_ATTR_VHT_CAPA]),
nla_data(tb_band[NL80211_BAND_ATTR_VHT_MCS_SET]));
+#ifdef IW_FULL
if (tb_band[NL80211_BAND_ATTR_IFTYPE_DATA]) {
struct nlattr *nl_iftype;
int rem_band;
@@ -171,6 +172,7 @@ static int print_phy_handler(struct nl_m
nla_for_each_nested(nl_iftype, tb_band[NL80211_BAND_ATTR_IFTYPE_DATA], rem_band)
print_he_info(nl_iftype);
}
+#endif
if (tb_band[NL80211_BAND_ATTR_FREQS]) {
if (!band_had_freq) {
printf("\t\tFrequencies:\n");
@@ -213,6 +215,7 @@ next:
}
}
@ -46,7 +62,7 @@
if (tb_band[NL80211_BAND_ATTR_RATES]) {
printf("\t\tBitrates (non-HT):\n");
nla_for_each_nested(nl_rate, tb_band[NL80211_BAND_ATTR_RATES], rem_rate) {
@@ -324,6 +325,7 @@ next:
@@ -229,6 +232,7 @@ next:
printf("\n");
}
}
@ -54,7 +70,7 @@
}
}
@@ -389,6 +391,7 @@ next:
@@ -294,6 +298,7 @@ next:
printf("\tCoverage class: %d (up to %dm)\n", coverage, 450 * coverage);
}
@ -62,7 +78,7 @@
if (tb_msg[NL80211_ATTR_CIPHER_SUITES]) {
int num = nla_len(tb_msg[NL80211_ATTR_CIPHER_SUITES]) / sizeof(__u32);
int i;
@@ -400,6 +403,7 @@ next:
@@ -305,6 +310,7 @@ next:
cipher_name(ciphers[i]));
}
}
@ -70,19 +86,21 @@
if (tb_msg[NL80211_ATTR_WIPHY_ANTENNA_AVAIL_TX] &&
tb_msg[NL80211_ATTR_WIPHY_ANTENNA_AVAIL_RX])
@@ -417,9 +421,11 @@ next:
print_iftype_list("\tSupported interface modes", "\t\t",
tb_msg[NL80211_ATTR_SUPPORTED_IFTYPES]);
@@ -324,11 +330,13 @@ next:
printf("\t\t * %s\n", iftype_name(nla_type(nl_mode)));
}
+#ifdef IW_FULL
if (tb_msg[NL80211_ATTR_SOFTWARE_IFTYPES])
print_iftype_list("\tsoftware interface modes (can always be added)",
"\t\t", tb_msg[NL80211_ATTR_SOFTWARE_IFTYPES]);
if (tb_msg[NL80211_ATTR_SOFTWARE_IFTYPES]) {
printf("\tsoftware interface modes (can always be added):\n");
nla_for_each_nested(nl_mode, tb_msg[NL80211_ATTR_SOFTWARE_IFTYPES], rem_mode)
printf("\t\t * %s\n", iftype_name(nla_type(nl_mode)));
}
+#endif
if (tb_msg[NL80211_ATTR_INTERFACE_COMBINATIONS]) {
struct nlattr *nl_combi;
@@ -509,6 +515,7 @@ broken_combination:
@@ -425,6 +433,7 @@ broken_combination:
printf("\tinterface combinations are not supported\n");
}
@ -90,7 +108,7 @@
if (tb_msg[NL80211_ATTR_SUPPORTED_COMMANDS]) {
printf("\tSupported commands:\n");
nla_for_each_nested(nl_cmd, tb_msg[NL80211_ATTR_SUPPORTED_COMMANDS], rem_cmd)
@@ -606,6 +613,7 @@ broken_combination:
@@ -522,6 +531,7 @@ broken_combination:
printf("\t\t * wake up on TCP connection\n");
}
}
@ -98,7 +116,7 @@
if (tb_msg[NL80211_ATTR_ROAM_SUPPORT])
printf("\tDevice supports roaming.\n");
@@ -644,6 +652,7 @@ broken_combination:
@@ -560,6 +570,7 @@ broken_combination:
}
}
@ -106,7 +124,7 @@
if (tb_msg[NL80211_ATTR_FEATURE_FLAGS]) {
unsigned int features = nla_get_u32(tb_msg[NL80211_ATTR_FEATURE_FLAGS]);
@@ -708,6 +717,7 @@ broken_combination:
@@ -624,6 +635,7 @@ broken_combination:
if (features & NL80211_FEATURE_ND_RANDOM_MAC_ADDR)
printf("\tDevice supports randomizing MAC-addr in net-detect scans.\n");
}
@ -114,7 +132,7 @@
if (tb_msg[NL80211_ATTR_TDLS_SUPPORT])
printf("\tDevice supports T-DLS.\n");
@@ -773,6 +783,7 @@ TOPLEVEL(list, NULL, NL80211_CMD_GET_WIP
@@ -732,6 +744,7 @@ TOPLEVEL(list, NULL, NL80211_CMD_GET_WIP
"List all wireless devices and their capabilities.");
TOPLEVEL(phy, NULL, NL80211_CMD_GET_WIPHY, NLM_F_DUMP, CIB_NONE, handle_info, NULL);
@ -122,7 +140,7 @@
static int handle_commands(struct nl80211_state *state, struct nl_msg *msg,
int argc, char **argv, enum id_input id)
{
@@ -784,6 +795,7 @@ static int handle_commands(struct nl8021
@@ -743,6 +756,7 @@ static int handle_commands(struct nl8021
}
TOPLEVEL(commands, NULL, NL80211_CMD_GET_WIPHY, 0, CIB_NONE, handle_commands,
"list all known commands and their decimal & hex value");
@ -132,7 +150,7 @@
{
--- a/scan.c
+++ b/scan.c
@@ -1306,6 +1306,9 @@ static void print_ht_op(const uint8_t ty
@@ -1195,6 +1195,9 @@ static void print_ht_op(const uint8_t ty
printf("\t\t * secondary channel offset: %s\n",
ht_secondary_offset[data[1] & 0x3]);
printf("\t\t * STA channel width: %s\n", sta_chan_width[(data[1] & 0x4)>>2]);
@ -142,7 +160,7 @@
printf("\t\t * RIFS: %d\n", (data[1] & 0x8)>>3);
printf("\t\t * HT protection: %s\n", protection[data[2] & 0x3]);
printf("\t\t * non-GF present: %d\n", (data[2] & 0x4) >> 2);
@@ -1716,6 +1719,14 @@ static void print_ie(const struct ie_pri
@@ -1522,6 +1525,14 @@ static void print_ie(const struct ie_pri
static const struct ie_print ieprinters[] = {
[0] = { "SSID", print_ssid, 0, 32, BIT(PRINT_SCAN) | BIT(PRINT_LINK), },
@ -157,15 +175,12 @@
[1] = { "Supported rates", print_supprates, 0, 255, BIT(PRINT_SCAN), },
[3] = { "DS Parameter set", print_ds, 1, 1, BIT(PRINT_SCAN), },
[5] = { "TIM", print_tim, 4, 255, BIT(PRINT_SCAN), },
@@ -1725,26 +1736,20 @@ static const struct ie_print ieprinters[
@@ -1531,21 +1542,15 @@ static const struct ie_print ieprinters[
[32] = { "Power constraint", print_powerconstraint, 1, 1, BIT(PRINT_SCAN), },
[35] = { "TPC report", print_tpcreport, 2, 2, BIT(PRINT_SCAN), },
[42] = { "ERP", print_erp, 1, 255, BIT(PRINT_SCAN), },
- [45] = { "HT capabilities", print_ht_capa, 26, 26, BIT(PRINT_SCAN), },
[47] = { "ERP D4.0", print_erp, 1, 255, BIT(PRINT_SCAN), },
[51] = { "AP Channel Report", print_ap_channel_report, 1, 255, BIT(PRINT_SCAN), },
[59] = { "Supported operating classes", print_supp_op_classes, 1, 255, BIT(PRINT_SCAN), },
[66] = { "Measurement Pilot Transmission", print_measurement_pilot_tx, 1, 255, BIT(PRINT_SCAN), },
[74] = { "Overlapping BSS scan params", print_obss_scan_params, 14, 255, BIT(PRINT_SCAN), },
- [61] = { "HT operation", print_ht_op, 22, 22, BIT(PRINT_SCAN), },
- [62] = { "Secondary Channel Offset", print_secchan_offs, 1, 1, BIT(PRINT_SCAN), },
@ -173,41 +188,33 @@
- [192] = { "VHT operation", print_vht_oper, 5, 255, BIT(PRINT_SCAN), },
- [48] = { "RSN", print_rsn, 2, 255, BIT(PRINT_SCAN), },
[50] = { "Extended supported rates", print_supprates, 0, 255, BIT(PRINT_SCAN), },
[70] = { "RM enabled capabilities", print_rm_enabled_capabilities, 5, 5, BIT(PRINT_SCAN), },
[113] = { "MESH Configuration", print_mesh_conf, 7, 7, BIT(PRINT_SCAN), },
- [114] = { "MESH ID", print_ssid, 0, 32, BIT(PRINT_SCAN) | BIT(PRINT_LINK), },
[127] = { "Extended capabilities", print_capabilities, 0, 255, BIT(PRINT_SCAN), },
[107] = { "802.11u Interworking", print_interworking, 0, 255, BIT(PRINT_SCAN), },
[108] = { "802.11u Advertisement", print_11u_advert, 0, 255, BIT(PRINT_SCAN), },
[111] = { "802.11u Roaming Consortium", print_11u_rcon, 2, 255, BIT(PRINT_SCAN), },
[195] = { "Transmit Power Envelope", print_tx_power_envelope, 2, 5, BIT(PRINT_SCAN), },
[111] = { "802.11u Roaming Consortium", print_11u_rcon, 0, 255, BIT(PRINT_SCAN), },
+#endif
};
static void print_wifi_wpa(const uint8_t type, uint8_t len, const uint8_t *data,
@@ -2080,8 +2085,10 @@ static void print_wifi_wps(const uint8_t
static const struct ie_print wifiprinters[] = {
[1] = { "WPA", print_wifi_wpa, 2, 255, BIT(PRINT_SCAN), },
@@ -2024,6 +2029,7 @@ void print_ies(unsigned char *ie, int ie
ieprinters[ie[0]].flags & BIT(ptype)) {
print_ie(&ieprinters[ie[0]],
ie[0], ie[1], ie + 2, &ie_buffer);
+#ifdef IW_FULL
[2] = { "WMM", print_wifi_wmm, 1, 255, BIT(PRINT_SCAN), },
[4] = { "WPS", print_wifi_wps, 0, 255, BIT(PRINT_SCAN), },
} else if (ie[0] == 221 /* vendor */) {
print_vendor(ie[1], ie + 2, unknown, ptype);
} else if (unknown) {
@@ -2033,6 +2039,7 @@ void print_ies(unsigned char *ie, int ie
for (i=0; i<ie[1]; i++)
printf(" %.2x", ie[2+i]);
printf("\n");
+#endif
};
static inline void print_p2p(const uint8_t type, uint8_t len,
@@ -2244,6 +2251,10 @@ static void print_vendor(unsigned char l
return;
}
+#ifdef IW_FULL
+ return;
+#endif
+
if (len >= 4 && memcmp(data, wfa_oui, 3) == 0) {
if (data[3] < ARRAY_SIZE(wfa_printers) &&
wfa_printers[data[3]].name &&
@@ -2377,6 +2388,7 @@ static void print_capa_non_dmg(__u16 cap
}
ielen -= ie[1] + 2;
ie += ie[1] + 2;
@@ -2073,6 +2080,7 @@ static void print_capa_non_dmg(__u16 cap
printf(" ESS");
if (capa & WLAN_CAPABILITY_IBSS)
printf(" IBSS");
@ -215,7 +222,7 @@
if (capa & WLAN_CAPABILITY_CF_POLLABLE)
printf(" CfPollable");
if (capa & WLAN_CAPABILITY_CF_POLL_REQUEST)
@@ -2405,6 +2417,7 @@ static void print_capa_non_dmg(__u16 cap
@@ -2101,6 +2109,7 @@ static void print_capa_non_dmg(__u16 cap
printf(" DelayedBACK");
if (capa & WLAN_CAPABILITY_IMM_BACK)
printf(" ImmediateBACK");
@ -223,7 +230,7 @@
}
static int print_bss_handler(struct nl_msg *msg, void *arg)
@@ -2489,8 +2502,10 @@ static int print_bss_handler(struct nl_m
@@ -2185,8 +2194,10 @@ static int print_bss_handler(struct nl_m
if (bss[NL80211_BSS_FREQUENCY]) {
int freq = nla_get_u32(bss[NL80211_BSS_FREQUENCY]);
printf("\tfreq: %d\n", freq);
@ -234,7 +241,7 @@
}
if (bss[NL80211_BSS_BEACON_INTERVAL])
printf("\tbeacon interval: %d TUs\n",
@@ -2684,6 +2699,7 @@ static int handle_stop_sched_scan(struct
@@ -2380,6 +2391,7 @@ static int handle_stop_sched_scan(struct
return 0;
}
@ -242,7 +249,7 @@
COMMAND(scan, sched_start,
SCHED_SCAN_OPTIONS,
NL80211_CMD_START_SCHED_SCAN, 0, CIB_NETDEV, handle_start_sched_scan,
@@ -2694,3 +2710,4 @@ COMMAND(scan, sched_start,
@@ -2390,3 +2402,4 @@ COMMAND(scan, sched_start,
COMMAND(scan, sched_stop, "",
NL80211_CMD_STOP_SCHED_SCAN, 0, CIB_NETDEV, handle_stop_sched_scan,
"Stop an ongoing scheduled scan.");
@ -265,7 +272,7 @@
int ieee80211_channel_to_frequency(int chan, enum nl80211_band band)
{
@@ -311,6 +313,9 @@ int parse_keys(struct nl_msg *msg, char
@@ -298,6 +300,9 @@ int parse_keys(struct nl_msg *msg, char
char keybuf[13];
int pos = 0;
@ -277,7 +284,7 @@
--- a/Makefile
+++ b/Makefile
@@ -23,6 +23,12 @@ _OBJS := $(sort $(patsubst %.c,%.o,$(wil
@@ -22,6 +22,12 @@ _OBJS := $(sort $(patsubst %.c,%.o,$(wil
VERSION_OBJS := $(filter-out version.o, $(_OBJS))
OBJS := $(VERSION_OBJS) version.o
@ -292,7 +299,7 @@
ifeq ($(NO_PKG_CONFIG),)
--- a/station.c
+++ b/station.c
@@ -777,10 +777,12 @@ static int handle_station_set_plink(stru
@@ -759,10 +759,12 @@ static int handle_station_set_plink(stru
nla_put_failure:
return -ENOBUFS;
}
@ -305,7 +312,7 @@
static int handle_station_set_vlan(struct nl80211_state *state,
struct nl_msg *msg,
@@ -875,11 +877,13 @@ static int handle_station_set_mesh_power
@@ -857,11 +859,13 @@ static int handle_station_set_mesh_power
nla_put_failure:
return -ENOBUFS;
}
@ -341,10 +348,10 @@
SECTION(switch);
COMMAND(switch, freq,
"<freq> [NOHT|HT20|HT40+|HT40-|5MHz|10MHz|80MHz] [beacons <count>] [block-tx]\n"
@@ -990,3 +993,4 @@ COMMAND(set, tidconf, "[peer <MAC addres
" $ iw dev wlan0 set tidconf peer xx:xx:xx:xx:xx:xx tids 0x2 bitrates auto\n"
" $ iw dev wlan0 set tidconf peer xx:xx:xx:xx:xx:xx tids 0x2 bitrates limit vht-mcs-5 4:9\n"
);
@@ -727,3 +730,4 @@ COMMAND(switch, freq,
"Switch the operating channel by sending a channel switch announcement (CSA).");
COMMAND(switch, channel, "<channel> [NOHT|HT20|HT40+|HT40-|5MHz|10MHz|80MHz] [beacons <count>] [block-tx]",
NL80211_CMD_CHANNEL_SWITCH, 0, CIB_NETDEV, handle_chan, NULL);
+#endif
--- a/phy.c
+++ b/phy.c

View File

@ -14,21 +14,19 @@
--- a/nl80211.h 2018-04-24 15:21:57.695128889 +0200
+++ b/nl80211.h 2018-04-24 15:18:56.415126745 +0200
@@ -3369,6 +3369,8 @@ enum nl80211_wmm_rule {
* on this channel in current regulatory domain.
* @NL80211_FREQUENCY_ATTR_16MHZ: 16 MHz operation is allowed
* on this channel in current regulatory domain.
* @NL80211_FREQUENCY_ATTR_WMM: this channel has wmm limitations.
* This is a nested attribute that contains the wmm limitation per AC.
* (see &enum nl80211_wmm_rule)
+* @NL80211_FREQUENCY_ATTR_SRD_CHANNEL: short range devices mode
+* on this channel in current regulatory domain.
* @NL80211_FREQUENCY_ATTR_MAX: highest frequency attribute number
* currently defined
* @__NL80211_FREQUENCY_ATTR_AFTER_LAST: internal use
@@ -3398,6 +3400,9 @@ enum nl80211_frequency_attr {
NL80211_FREQUENCY_ATTR_4MHZ,
NL80211_FREQUENCY_ATTR_8MHZ,
NL80211_FREQUENCY_ATTR_16MHZ,
+ NL80211_FREQUENCY_ATTR_NO_320MHZ,
+ NL80211_FREQUENCY_ATTR_NO_EHT,
+ NL80211_FREQUENCY_ATTR_SRD_CHANNEL,
@@ -3398,6 +3400,7 @@ enum nl80211_frequency_attr {
NL80211_FREQUENCY_ATTR_NO_20MHZ,
NL80211_FREQUENCY_ATTR_NO_10MHZ,
NL80211_FREQUENCY_ATTR_WMM,
+ NL80211_FREQUENCY_ATTR_SRD_CHANNEL,
/* keep last */
__NL80211_FREQUENCY_ATTR_AFTER_LAST,

View File

@ -7,7 +7,7 @@ SECTION = "base"
LICENSE = "BSD"
LIC_FILES_CHKSUM = "file://COPYING;md5=878618a5c4af25e9b93ef0be1a93f774"
DEPENDS = "libnl-tiny"
DEPENDS = "libnl"
SRC_URI = "http://www.kernel.org/pub/software/network/iw/${BP}.tar.xz \
file://0001-Remove-obsolete-library.patch \
@ -19,26 +19,24 @@ SRC_URI = "http://www.kernel.org/pub/software/network/iw/${BP}.tar.xz \
file://401-wlan-indoor-channel.patch \
file://402-show-ant-gain.patch \
file://403-clockbootime.patch \
file://separate-objdir.patch \
"
SRC_URI[sha256sum] = "f167bbe947dd53bb9ebc0c1dcef5db6ad73ac1d6084f2c6f9376c5c360cc4d4e"
SRC_URI[sha256sum] = "a2469f677088d7b1070a7fbb28f3c747041697e8f6ec70783339cb1bc27a395f"
inherit pkgconfig
CFLAGS += "-I${STAGING_DIR_TARGET}/usr/include/libnl-tiny -lnl-tiny -DCONFIG_LIBNL20 -D_GNU_SOURCE"
LDFLAGS += " -Wl,--gc-sections"
#CFLAGS += "-I${STAGING_DIR_TARGET}/usr/include/libnl -lnl -DCONFIG_LIBNL20 -D_GNU_SOURCE"
#LDFLAGS += " -Wl,--gc-sections"
CFLAGS_remove += "-lnl-genl"
#CFLAGS_remove += "-lnl-genl"
EXTRA_OEMAKE = "\
EXTRA_OEMAKE = "\
-f '${S}/Makefile' \
\
'PREFIX=${prefix}' \
'SBINDIR=${sbindir}' \
'MANDIR=${mandir}' \
'NLLIBNAME=libnl-tiny' \
'NL1FOUND=""' \
'NL2FOUND=Y' \
"
do_compile() {

View File

@ -59,7 +59,7 @@ index 2f1ed93..317d01c 100644
-
-$(REGDB_PUBCERT): $(REGDB_PRIVKEY)
- @echo "Generating certificate for $(REGDB_AUTHOR)..."
- ./gen-pubcert.sh $(REGDB_PRIVKEY) $(REGDB_PUBCERT) $(REGDB_AUTHOR)
- ./gen-pubcert.sh $(REGDB_PRIVKEY) $(REGDB_PUBCERT)
- @echo $(REGDB_PUBKEY) > .custom
-
-

View File

@ -1,24 +0,0 @@
--- a/db2bin.py
+++ b/db2bin.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
from io import BytesIO, open
import struct
--- a/db2fw.py
+++ b/db2fw.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
from io import BytesIO, open
import struct
--- a/dbparse.py
+++ b/dbparse.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
from functools import total_ordering
import sys, math

View File

@ -9,11 +9,11 @@ DEPENDS = "openssl-native"
SRC_URI = "git://git.kernel.org/pub/scm/linux/kernel/git/sforshee/wireless-regdb.git;protocol=http \
file://100-regdb-write-firmware-file-format-version-code-20.patch \
file://500-world-regd-5GHz.patch \
file://501-change-python-interpreter-to-version-3-to-be-compat.patch \
file://regulatory.db \
file://0001-ADD-regdb-EU-section-with-ranges-allowed-for-all-EU-.patch \
"
SRCREV = "9dc9c89375c996c4d1d1a8c0a76f9dd04e244077"
SRCREV = "222442d26a8ce40a3c06f31aedf8c7adcc3d5f73"
S = "${WORKDIR}/git"

View File

@ -1,9 +0,0 @@
do_install_append_class-target () {
ln -sf flex ${D}${bindir}/lex
ln -sf flex ${D}${bindir}/lex++
}
do_install_append () {
ln -sf flex ${D}${bindir}/lex
ln -sf flex ${D}${bindir}/lex++
}

View File

@ -1,26 +0,0 @@
SUMMARY = "ath10k candelatech firmware for use with Linux kernel"
DESCRIPTION = "firmware for QCA ath10k based chipset like QCA988X from candelatech"
HOMEPAGE = "https://www.candelatech.com/"
SECTION = "base"
LICENSE = "CLOSED"
SRC_URI = "https://www.candelatech.com/downloads/firmware-2-ct-full-community-22.bin.lede.022"
SRC_URI[md5sum] = "3466a8f5e2edf8f737ce82d5aba71bd1"
S = "${WORKDIR}"
inherit allarch
do_compile() {
:
}
do_install() {
install -d ${D}${nonarch_base_libdir}/firmware/ath10k/QCA988X/hw2.0/
cp ${WORKDIR}/firmware-2-ct-full-community-22.bin.lede.022 ${D}${nonarch_base_libdir}/firmware/ath10k/QCA988X/hw2.0/firmware-2.bin
}
FILES_${PN} = "/lib/firmware"

View File

@ -1,23 +0,0 @@
SUMMARY = "TI wl18xx firmware for use with Linux kernel"
DESCRIPTION = "firmware forTI wl18xx based chipsets like wl1837"
HOMEPAGE = "https://git.ti.com/cgit/wilink8-wlan/wl18xx_fw/"
SECTION = "base"
LICENSE = "Firmware-ti-wl18xx"
LIC_FILES_CHKSUM = "file://LICENCE;md5=4977a0fe767ee17765ae63c435a32a9e"
NO_GENERIC_LICENSE[Firmware-ti-wl18xx]="LICENCE"
SRC_URI += " \
git://git.ti.com/wilink8-wlan/wl18xx_fw.git \
"
SRCREV = "5ec05007f2662f460f881c5868311fd3ab7e6e71"
S = "${WORKDIR}/git"
do_install () {
install -d ${D}${nonarch_base_libdir}/firmware/ti-connectivity/
install -m 0644 wl18xx-fw-4.bin ${D}${nonarch_base_libdir}/firmware/ti-connectivity/wl18xx-fw-4-mesh.bin
}
FILES_${PN} = "${nonarch_base_libdir}/firmware"

Some files were not shown because too many files have changed in this diff Show More