hostapd: update to git HEAD of 2018-05-21, allow build against wolfssl

Support for building wpa_supplicant/hostapd against wolfssl has been
added upstream recently, add build option to allow users using it.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
This commit is contained in:
Daniel Golle 2018-04-28 21:12:19 +02:00
parent 51740777fb
commit 69f544937f
37 changed files with 604 additions and 297 deletions

View file

@ -1,7 +1,7 @@
# wpa_supplicant config
config WPA_SUPPLICANT_NO_TIMESTAMP_CHECK
bool "Disable timestamp check"
depends on PACKAGE_wpa-supplicant || PACKAGE_wpa-supplicant-mesh || PACKAGE_wpa-supplicant-mini || PACKAGE_wpad || PACKAGE_wpad-mini || PACAKGE_wpad-mesh
depends on PACKAGE_wpa-supplicant || PACKAGE_wpa-supplicant-mesh || PACKAGE_wpa-supplicant-mini || PACKAGE_wpad || PACKAGE_wpad-mini || PACKAGE_wpad-mesh
default n
help
This disables the timestamp check for certificates in wpa_supplicant
@ -10,15 +10,30 @@ config WPA_SUPPLICANT_NO_TIMESTAMP_CHECK
choice
prompt "Choose TLS provider"
default WPA_SUPPLICANT_INTERNAL
depends on PACKAGE_wpa-supplicant || PACKAGE_wpad
depends on PACKAGE_wpa-supplicant || PACKAGE_wpad || PACKAGE_wpad-mesh
config WPA_SUPPLICANT_INTERNAL
bool "internal"
depends on PACKAGE_wpa-supplicant || PACKAGE_wpad
config WPA_SUPPLICANT_OPENSSL
bool "openssl"
select PACKAGE_libopenssl
config WPA_SUPPLICANT_WOLFSSL
bool "wolfssl"
select PACKAGE_libwolfssl
select WOLFSSL_HAS_AES_CCM
select WOLFSSL_HAS_AES_GCM
select WOLFSSL_HAS_ARC4
select WOLFSSL_HAS_DES3
select WOLFSSL_HAS_DH
select WOLFSSL_HAS_ECC
select WOLFSSL_HAS_OCSP
select WOLFSSL_HAS_PSK
select WOLFSSL_HAS_SESSION_TICKET
select WOLFSSL_HAS_WPAS
endchoice
config WPA_RFKILL_SUPPORT

View file

@ -7,13 +7,13 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=hostapd
PKG_RELEASE:=5
PKG_RELEASE:=1
PKG_SOURCE_URL:=http://w1.fi/hostap.git
PKG_SOURCE_PROTO:=git
PKG_SOURCE_DATE:=2018-04-09
PKG_SOURCE_VERSION:=fa617ee6a0b2d39e6372c93ef9437caa3bd9065a
PKG_MIRROR_HASH:=5e6f20153c3405ac905f89fea8a614a57e9ba19583b2de2777179381a74aa7b1
PKG_SOURCE_DATE:=2018-05-21
PKG_SOURCE_VERSION:=62566bc23d041e88f8e35933d5fd8c2fd0f7cf2a
PKG_MIRROR_HASH:=f234b24f9471ae9cb34460feec6d6614641691544101535673595272c91448eb
PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
PKG_LICENSE:=BSD-3-Clause
@ -47,7 +47,13 @@ ifneq ($(LOCAL_TYPE),hostapd)
ifeq ($(LOCAL_VARIANT),full)
PKG_CONFIG_DEPENDS += \
CONFIG_WPA_SUPPLICANT_INTERNAL \
CONFIG_WPA_SUPPLICANT_OPENSSL
CONFIG_WPA_SUPPLICANT_OPENSSL \
CONFIG_WPA_SUPPLICANT_WOLFSSL
endif
ifeq ($(LOCAL_VARIANT),mesh)
PKG_CONFIG_DEPENDS += \
CONFIG_WPA_SUPPLICANT_OPENSSL \
CONFIG_WPA_SUPPLICANT_WOLFSSL
endif
endif
@ -83,10 +89,23 @@ ifneq ($(LOCAL_TYPE),hostapd)
TARGET_LDFLAGS += -lcrypto -lssl
endif
endif
ifdef CONFIG_WPA_SUPPLICANT_WOLFSSL
ifeq ($(LOCAL_VARIANT),full)
DRIVER_MAKEOPTS += CONFIG_TLS=wolfssl CONFIG_WPS_NFC=1
TARGET_LDFLAGS += -lwolfssl
endif
endif
ifeq ($(LOCAL_VARIANT),mesh)
ifndef CONFIG_WPA_SUPPLICANT_WOLFSSL
DRIVER_MAKEOPTS += CONFIG_TLS=openssl CONFIG_AP=y CONFIG_SAE=y CONFIG_MESH=y
TARGET_LDFLAGS += -lcrypto -lssl
else
DRIVER_MAKEOPTS += CONFIG_TLS=wolfssl CONFIG_WPS_NFC=1 CONFIG_AP=y CONFIG_SAE=y CONFIG_MESH=y
TARGET_LDFLAGS += -lwolfssl
endif
endif
ifdef CONFIG_WPA_SUPPLICANT_NO_TIMESTAMP_CHECK
TARGET_CFLAGS += -DNO_TIMESTAMP_CHECK
endif
@ -157,7 +176,7 @@ endef
define Package/wpad
$(call Package/wpad/Default)
TITLE+= (full)
DEPENDS+=+WPA_SUPPLICANT_OPENSSL:libopenssl
DEPENDS+=+WPA_SUPPLICANT_OPENSSL:libopenssl +WPA_SUPPLICANT_WOLFSSL:libwolfssl
VARIANT:=wpad-full
endef
@ -179,7 +198,7 @@ endef
define Package/wpad-mesh
$(call Package/wpad/Default)
TITLE+= (with 802.11s mesh and SAE support)
DEPENDS:=$(DRV_DEPENDS) +libubus +PACKAGE_wpad-mesh:libopenssl @PACKAGE_kmod-cfg80211 @(!TARGET_uml||BROKEN)
DEPENDS:=$(DRV_DEPENDS) +libubus +WPA_SUPPLICANT_OPENSSL:libopenssl +WPA_SUPPLICANT_INTERNAL:libopenssl +WPA_SUPPLICANT_WOLFSSL:libwolfssl @PACKAGE_kmod-cfg80211 @(!TARGET_uml||BROKEN)
VARIANT:=wpad-mesh
endef
@ -192,7 +211,7 @@ define Package/wpa-supplicant
CATEGORY:=Network
TITLE:=WPA Supplicant
URL:=http://hostap.epitest.fi/wpa_supplicant/
DEPENDS:=$(DRV_DEPENDS) +WPA_SUPPLICANT_OPENSSL:libopenssl
DEPENDS:=$(DRV_DEPENDS) +WPA_SUPPLICANT_OPENSSL:libopenssl +WPA_SUPPLICANT_WOLFSSL:libwolfssl
CONFLICTS:=wpad wpad-mini wpad-mesh
VARIANT:=supplicant-full
endef
@ -212,7 +231,7 @@ endef
define Package/wpa-supplicant-mesh
$(Package/wpa-supplicant)
TITLE:=WPA Supplicant (with 802.11s and SAE)
DEPENDS:=$(DRV_DEPENDS) +PACKAGE_wpa-supplicant-mesh:libopenssl @PACKAGE_kmod-cfg80211 @(!TARGET_uml||BROKEN)
DEPENDS:=$(DRV_DEPENDS) +WPA_SUPPLICANT_OPENSSL:libopenssl +WPA_SUPPLICANT_INTERNAL:libopenssl +WPA_SUPPLICANT_WOLFSSL:libwolfssl @PACKAGE_kmod-cfg80211 @(!TARGET_uml||BROKEN)
CONFLICTS:=wpad wpad-mesh wpad-mesh
VARIANT:=supplicant-mesh
endef
@ -243,7 +262,7 @@ define Package/eapol-test
SECTION:=net
CATEGORY:=Network
VARIANT:=supplicant-full
DEPENDS:=$(DRV_DEPENDS) +WPA_SUPPLICANT_OPENSSL:libopenssl
DEPENDS:=$(DRV_DEPENDS) +WPA_SUPPLICANT_OPENSSL:libopenssl +WPA_SUPPLICANT_WOLFSSL:libwolfssl
endef

View file

@ -688,11 +688,12 @@ wpa_supplicant_add_network() {
}
[[ "$_w_mode" = "mesh" ]] && {
json_get_vars mesh_id mesh_fwding
json_get_vars mesh_id mesh_fwding mesh_rssi_threshold
[ -n "$mesh_id" ] && ssid="${mesh_id}"
append network_data "mode=5" "$N$T"
[ -n "$mesh_fwding" ] && append network_data "mesh_fwding=${mesh_fwding}" "$N$T"
[ -n "$mesh_rssi_threshold" ] && append network_data "mesh_rssi_threshold=${mesh_rssi_threshold}" "$N$T"
[ -n "$freq" ] && wpa_supplicant_set_fixed_freq "$freq" "$htmode"
[ "$noscan" = "1" ] && append network_data "noscan=1" "$N$T"
append wpa_key_mgmt "SAE"

View file

@ -0,0 +1,185 @@
From 8a6a7112e5b1391018531f6b6c317f8870e0fcb6 Mon Sep 17 00:00:00 2001
From: Daniel Golle <daniel@makrotopia.org>
Date: Thu, 3 May 2018 13:12:28 +0200
Subject: [PATCH 1/2] Revert "wpa_supplicant: Increase authentication timeout
if CAC is started"
This reverts commit 37547ad63c9df61ce6899675028594da2527efef.
---
wpa_supplicant/events.c | 95 ++++---------------------------
wpa_supplicant/wpa_supplicant.c | 20 -------
wpa_supplicant/wpa_supplicant_i.h | 3 -
3 files changed, 10 insertions(+), 108 deletions(-)
--- a/wpa_supplicant/events.c
+++ b/wpa_supplicant/events.c
@@ -3776,81 +3776,6 @@ static void wpa_supplicant_event_port_au
}
-static unsigned int wpas_event_cac_ms(const struct wpa_supplicant *wpa_s,
- int freq)
-{
- size_t i;
- int j;
-
- for (i = 0; i < wpa_s->hw.num_modes; i++) {
- const struct hostapd_hw_modes *mode = &wpa_s->hw.modes[i];
-
- for (j = 0; j < mode->num_channels; j++) {
- const struct hostapd_channel_data *chan;
-
- chan = &mode->channels[j];
- if (chan->freq == freq)
- return chan->dfs_cac_ms;
- }
- }
-
- return 0;
-}
-
-
-static void wpas_event_dfs_cac_started(struct wpa_supplicant *wpa_s,
- struct dfs_event *radar)
-{
-#if defined(NEED_AP_MLME) && defined(CONFIG_AP)
- if (wpa_s->ap_iface) {
- wpas_ap_event_dfs_cac_started(wpa_s, radar);
- } else
-#endif /* NEED_AP_MLME && CONFIG_AP */
- {
- unsigned int cac_time = wpas_event_cac_ms(wpa_s, radar->freq);
-
- cac_time /= 1000; /* convert from ms to sec */
- if (!cac_time)
- cac_time = 10 * 60; /* max timeout: 10 minutes */
-
- /* Restart auth timeout: CAC time added to initial timeout */
- wpas_auth_timeout_restart(wpa_s, cac_time);
- }
-}
-
-
-static void wpas_event_dfs_cac_finished(struct wpa_supplicant *wpa_s,
- struct dfs_event *radar)
-{
-#if defined(NEED_AP_MLME) && defined(CONFIG_AP)
- if (wpa_s->ap_iface) {
- wpas_ap_event_dfs_cac_finished(wpa_s, radar);
- } else
-#endif /* NEED_AP_MLME && CONFIG_AP */
- {
- /* Restart auth timeout with original value after CAC is
- * finished */
- wpas_auth_timeout_restart(wpa_s, 0);
- }
-}
-
-
-static void wpas_event_dfs_cac_aborted(struct wpa_supplicant *wpa_s,
- struct dfs_event *radar)
-{
-#if defined(NEED_AP_MLME) && defined(CONFIG_AP)
- if (wpa_s->ap_iface) {
- wpas_ap_event_dfs_cac_aborted(wpa_s, radar);
- } else
-#endif /* NEED_AP_MLME && CONFIG_AP */
- {
- /* Restart auth timeout with original value after CAC is
- * aborted */
- wpas_auth_timeout_restart(wpa_s, 0);
- }
-}
-
-
static void wpa_supplicant_event_assoc_auth(struct wpa_supplicant *wpa_s,
union wpa_event_data *data)
{
@@ -4298,25 +4223,25 @@ void wpa_supplicant_event(void *ctx, enu
wpas_ap_event_dfs_radar_detected(wpa_s,
&data->dfs_event);
break;
- case EVENT_DFS_NOP_FINISHED:
- if (data)
- wpas_ap_event_dfs_cac_nop_finished(wpa_s,
- &data->dfs_event);
- break;
-#endif /* NEED_AP_MLME */
-#endif /* CONFIG_AP */
case EVENT_DFS_CAC_STARTED:
if (data)
- wpas_event_dfs_cac_started(wpa_s, &data->dfs_event);
+ wpas_ap_event_dfs_cac_started(wpa_s, &data->dfs_event);
break;
case EVENT_DFS_CAC_FINISHED:
if (data)
- wpas_event_dfs_cac_finished(wpa_s, &data->dfs_event);
+ wpas_ap_event_dfs_cac_finished(wpa_s, &data->dfs_event);
break;
case EVENT_DFS_CAC_ABORTED:
if (data)
- wpas_event_dfs_cac_aborted(wpa_s, &data->dfs_event);
+ wpas_ap_event_dfs_cac_aborted(wpa_s, &data->dfs_event);
+ break;
+ case EVENT_DFS_NOP_FINISHED:
+ if (data)
+ wpas_ap_event_dfs_cac_nop_finished(wpa_s,
+ &data->dfs_event);
break;
+#endif /* NEED_AP_MLME */
+#endif /* CONFIG_AP */
case EVENT_RX_MGMT: {
u16 fc, stype;
const struct ieee80211_mgmt *mgmt;
--- a/wpa_supplicant/wpa_supplicant.c
+++ b/wpa_supplicant/wpa_supplicant.c
@@ -243,30 +243,10 @@ void wpa_supplicant_req_auth_timeout(str
wpa_dbg(wpa_s, MSG_DEBUG, "Setting authentication timeout: %d sec "
"%d usec", sec, usec);
eloop_cancel_timeout(wpa_supplicant_timeout, wpa_s, NULL);
- wpa_s->last_auth_timeout_sec = sec;
eloop_register_timeout(sec, usec, wpa_supplicant_timeout, wpa_s, NULL);
}
-/*
- * wpas_auth_timeout_restart - Restart and change timeout for authentication
- * @wpa_s: Pointer to wpa_supplicant data
- * @sec_diff: difference in seconds applied to original timeout value
- */
-void wpas_auth_timeout_restart(struct wpa_supplicant *wpa_s, int sec_diff)
-{
- int new_sec = wpa_s->last_auth_timeout_sec + sec_diff;
-
- if (eloop_is_timeout_registered(wpa_supplicant_timeout, wpa_s, NULL)) {
- wpa_dbg(wpa_s, MSG_DEBUG,
- "Authentication timeout restart: %d sec", new_sec);
- eloop_cancel_timeout(wpa_supplicant_timeout, wpa_s, NULL);
- eloop_register_timeout(new_sec, 0, wpa_supplicant_timeout,
- wpa_s, NULL);
- }
-}
-
-
/**
* wpa_supplicant_cancel_auth_timeout - Cancel authentication timeout
* @wpa_s: Pointer to wpa_supplicant data
--- a/wpa_supplicant/wpa_supplicant_i.h
+++ b/wpa_supplicant/wpa_supplicant_i.h
@@ -1182,8 +1182,6 @@ struct wpa_supplicant {
/* RIC elements for FT protocol */
struct wpabuf *ric_ies;
- int last_auth_timeout_sec;
-
#ifdef CONFIG_DPP
struct dl_list dpp_bootstrap; /* struct dpp_bootstrap_info */
struct dl_list dpp_configurator; /* struct dpp_configurator */
@@ -1258,7 +1256,6 @@ void wpa_supplicant_initiate_eapol(struc
void wpa_clear_keys(struct wpa_supplicant *wpa_s, const u8 *addr);
void wpa_supplicant_req_auth_timeout(struct wpa_supplicant *wpa_s,
int sec, int usec);
-void wpas_auth_timeout_restart(struct wpa_supplicant *wpa_s, int sec_diff);
void wpa_supplicant_reinit_autoscan(struct wpa_supplicant *wpa_s);
void wpa_supplicant_set_state(struct wpa_supplicant *wpa_s,
enum wpa_states state);

View file

@ -0,0 +1,132 @@
From 0d4900ccd1c7ec5c5ffecf5040f9c07a6a32deef Mon Sep 17 00:00:00 2001
From: Daniel Golle <daniel@makrotopia.org>
Date: Thu, 3 May 2018 13:12:35 +0200
Subject: [PATCH 2/2] Revert "wpa_supplicant: Rename wpas_event_*() to
wpas_ap_event_*()"
This reverts commit 2dd5fbbff884af488870a37e339b4817c83954de.
---
wpa_supplicant/ap.c | 20 ++++++++++----------
wpa_supplicant/ap.h | 18 +++++++++---------
wpa_supplicant/events.c | 13 ++++++-------
3 files changed, 25 insertions(+), 26 deletions(-)
--- a/wpa_supplicant/ap.c
+++ b/wpa_supplicant/ap.c
@@ -1537,8 +1537,8 @@ int wpas_ap_pmksa_cache_add_external(str
#ifdef NEED_AP_MLME
-void wpas_ap_event_dfs_radar_detected(struct wpa_supplicant *wpa_s,
- struct dfs_event *radar)
+void wpas_event_dfs_radar_detected(struct wpa_supplicant *wpa_s,
+ struct dfs_event *radar)
{
if (!wpa_s->ap_iface || !wpa_s->ap_iface->bss[0])
return;
@@ -1550,8 +1550,8 @@ void wpas_ap_event_dfs_radar_detected(st
}
-void wpas_ap_event_dfs_cac_started(struct wpa_supplicant *wpa_s,
- struct dfs_event *radar)
+void wpas_event_dfs_cac_started(struct wpa_supplicant *wpa_s,
+ struct dfs_event *radar)
{
if (!wpa_s->ap_iface || !wpa_s->ap_iface->bss[0])
return;
@@ -1562,8 +1562,8 @@ void wpas_ap_event_dfs_cac_started(struc
}
-void wpas_ap_event_dfs_cac_finished(struct wpa_supplicant *wpa_s,
- struct dfs_event *radar)
+void wpas_event_dfs_cac_finished(struct wpa_supplicant *wpa_s,
+ struct dfs_event *radar)
{
if (!wpa_s->ap_iface || !wpa_s->ap_iface->bss[0])
return;
@@ -1574,8 +1574,8 @@ void wpas_ap_event_dfs_cac_finished(stru
}
-void wpas_ap_event_dfs_cac_aborted(struct wpa_supplicant *wpa_s,
- struct dfs_event *radar)
+void wpas_event_dfs_cac_aborted(struct wpa_supplicant *wpa_s,
+ struct dfs_event *radar)
{
if (!wpa_s->ap_iface || !wpa_s->ap_iface->bss[0])
return;
@@ -1586,8 +1586,8 @@ void wpas_ap_event_dfs_cac_aborted(struc
}
-void wpas_ap_event_dfs_cac_nop_finished(struct wpa_supplicant *wpa_s,
- struct dfs_event *radar)
+void wpas_event_dfs_cac_nop_finished(struct wpa_supplicant *wpa_s,
+ struct dfs_event *radar)
{
if (!wpa_s->ap_iface || !wpa_s->ap_iface->bss[0])
return;
--- a/wpa_supplicant/ap.h
+++ b/wpa_supplicant/ap.h
@@ -89,16 +89,16 @@ int wpas_ap_pmksa_cache_list_mesh(struct
char *buf, size_t len);
int wpas_ap_pmksa_cache_add_external(struct wpa_supplicant *wpa_s, char *cmd);
-void wpas_ap_event_dfs_radar_detected(struct wpa_supplicant *wpa_s,
- struct dfs_event *radar);
-void wpas_ap_event_dfs_cac_started(struct wpa_supplicant *wpa_s,
+void wpas_event_dfs_radar_detected(struct wpa_supplicant *wpa_s,
struct dfs_event *radar);
-void wpas_ap_event_dfs_cac_finished(struct wpa_supplicant *wpa_s,
- struct dfs_event *radar);
-void wpas_ap_event_dfs_cac_aborted(struct wpa_supplicant *wpa_s,
- struct dfs_event *radar);
-void wpas_ap_event_dfs_cac_nop_finished(struct wpa_supplicant *wpa_s,
- struct dfs_event *radar);
+void wpas_event_dfs_cac_started(struct wpa_supplicant *wpa_s,
+ struct dfs_event *radar);
+void wpas_event_dfs_cac_finished(struct wpa_supplicant *wpa_s,
+ struct dfs_event *radar);
+void wpas_event_dfs_cac_aborted(struct wpa_supplicant *wpa_s,
+ struct dfs_event *radar);
+void wpas_event_dfs_cac_nop_finished(struct wpa_supplicant *wpa_s,
+ struct dfs_event *radar);
void ap_periodic(struct wpa_supplicant *wpa_s);
--- a/wpa_supplicant/events.c
+++ b/wpa_supplicant/events.c
@@ -4220,25 +4220,24 @@ void wpa_supplicant_event(void *ctx, enu
#ifdef NEED_AP_MLME
case EVENT_DFS_RADAR_DETECTED:
if (data)
- wpas_ap_event_dfs_radar_detected(wpa_s,
- &data->dfs_event);
+ wpas_event_dfs_radar_detected(wpa_s, &data->dfs_event);
break;
case EVENT_DFS_CAC_STARTED:
if (data)
- wpas_ap_event_dfs_cac_started(wpa_s, &data->dfs_event);
+ wpas_event_dfs_cac_started(wpa_s, &data->dfs_event);
break;
case EVENT_DFS_CAC_FINISHED:
if (data)
- wpas_ap_event_dfs_cac_finished(wpa_s, &data->dfs_event);
+ wpas_event_dfs_cac_finished(wpa_s, &data->dfs_event);
break;
case EVENT_DFS_CAC_ABORTED:
if (data)
- wpas_ap_event_dfs_cac_aborted(wpa_s, &data->dfs_event);
+ wpas_event_dfs_cac_aborted(wpa_s, &data->dfs_event);
break;
case EVENT_DFS_NOP_FINISHED:
if (data)
- wpas_ap_event_dfs_cac_nop_finished(wpa_s,
- &data->dfs_event);
+ wpas_event_dfs_cac_nop_finished(wpa_s,
+ &data->dfs_event);
break;
#endif /* NEED_AP_MLME */
#endif /* CONFIG_AP */

View file

@ -1,7 +1,7 @@
From 91c0f3f6a9ecae3c9106bef8a8606fab0792dd28 Mon Sep 17 00:00:00 2001
From 032e70833de4b251fc4a159b2cc4ef28d0f1df0d Mon Sep 17 00:00:00 2001
From: Peter Oh <peter.oh@bowerswilkins.com>
Date: Thu, 12 Apr 2018 02:48:58 -0700
Subject: [PATCH 01/15] mesh: factor out mesh join function
Date: Tue, 17 Apr 2018 21:54:58 -0700
Subject: [PATCH 01/16] mesh: factor out mesh join function
mesh join function consitss of 2 parts which are preparing
configurations and sending join event to driver.
@ -12,22 +12,14 @@ into 2 parts to reduce redundant calls.
Signed-off-by: Peter Oh <peter.oh@bowerswilkins.com>
---
wpa_supplicant/mesh.c | 120 ++++++++++++++++--------------
wpa_supplicant/mesh.c | 119 ++++++++++++++++--------------
wpa_supplicant/mesh.h | 1 +
wpa_supplicant/wpa_supplicant_i.h | 1 +
3 files changed, 68 insertions(+), 54 deletions(-)
3 files changed, 67 insertions(+), 54 deletions(-)
--- a/wpa_supplicant/mesh.c
+++ b/wpa_supplicant/mesh.c
@@ -25,6 +25,7 @@
#include "mesh_mpm.h"
#include "mesh_rsn.h"
#include "mesh.h"
+#include "drivers/driver_nl80211.h"
static void wpa_supplicant_mesh_deinit(struct wpa_supplicant *wpa_s)
@@ -359,13 +360,48 @@ void wpa_supplicant_mesh_add_scan_ie(str
@@ -363,13 +363,48 @@ void wpa_supplicant_mesh_add_scan_ie(str
}
@ -78,7 +70,7 @@ Signed-off-by: Peter Oh <peter.oh@bowerswilkins.com>
ret = -ENOENT;
goto out;
}
@@ -376,22 +412,22 @@ int wpa_supplicant_join_mesh(struct wpa_
@@ -380,22 +415,22 @@ int wpa_supplicant_join_mesh(struct wpa_
wpa_s->group_cipher = WPA_CIPHER_NONE;
wpa_s->mgmt_group_cipher = 0;
@ -112,7 +104,7 @@ Signed-off-by: Peter Oh <peter.oh@bowerswilkins.com>
} else {
ssid->max_oper_chwidth = VHT_CHANWIDTH_80MHZ;
}
@@ -405,67 +441,43 @@ int wpa_supplicant_join_mesh(struct wpa_
@@ -409,67 +444,43 @@ int wpa_supplicant_join_mesh(struct wpa_
}
}
if (ssid->beacon_int > 0)

View file

@ -1,7 +1,7 @@
From 04ebcadc059a6cfd45cd8ec06e6321b69bdb68b8 Mon Sep 17 00:00:00 2001
From 6da64b1e056e0b1be18b6ab37c820acb4a0f3cf4 Mon Sep 17 00:00:00 2001
From: Peter Oh <peter.oh@bowerswilkins.com>
Date: Thu, 12 Apr 2018 02:48:59 -0700
Subject: [PATCH 02/15] mesh: factor out rsn initialization
Date: Tue, 17 Apr 2018 21:54:59 -0700
Subject: [PATCH 02/16] mesh: factor out rsn initialization
RSN initialization can be used in different phases
if mesh initialization and mesh join don't happen
@ -10,16 +10,16 @@ hence factor it out to help convering the case.
Signed-off-by: Peter Oh <peter.oh@bowerswilkins.com>
---
wpa_supplicant/mesh.c | 73 ++++++++++++++++++++++++++-----------------
wpa_supplicant/mesh.c | 84 +++++++++++++++++++++++++------------------
wpa_supplicant/mesh.h | 1 +
2 files changed, 45 insertions(+), 29 deletions(-)
2 files changed, 50 insertions(+), 35 deletions(-)
--- a/wpa_supplicant/mesh.c
+++ b/wpa_supplicant/mesh.c
@@ -147,6 +147,48 @@ static void wpas_mesh_copy_groups(struct
groups_size);
@@ -147,6 +147,53 @@ static void wpas_mesh_copy_groups(struct
}
+int wpas_mesh_init_rsn(struct wpa_supplicant *wpa_s)
+{
+ struct hostapd_iface *ifmsh = wpa_s->ifmsh;
@ -27,10 +27,14 @@ Signed-off-by: Peter Oh <peter.oh@bowerswilkins.com>
+ struct wpa_ssid *ssid = wpa_s->current_ssid;
+ struct hostapd_data *bss = ifmsh->bss[0];
+ static int default_groups[] = { 19, 20, 21, 25, 26, -1 };
+ const char *password;
+ size_t len;
+
+ if (mconf->security != MESH_CONF_SEC_NONE) {
+ if (ssid->passphrase == NULL) {
+ password = ssid->sae_password;
+ if (!password)
+ password = ssid->passphrase;
+ if (!password) {
+ wpa_printf(MSG_ERROR,
+ "mesh: Passphrase for SAE not configured");
+ return -1;
@ -50,9 +54,9 @@ Signed-off-by: Peter Oh <peter.oh@bowerswilkins.com>
+ return -1;
+ }
+
+ len = os_strlen(ssid->passphrase);
+ len = os_strlen(password);
+ bss->conf->ssid.wpa_passphrase =
+ dup_binstr(ssid->passphrase, len);
+ dup_binstr(password, len);
+
+ wpa_s->mesh_rsn = mesh_rsn_auth_init(wpa_s, mconf);
+ if (!wpa_s->mesh_rsn)
@ -62,15 +66,29 @@ Signed-off-by: Peter Oh <peter.oh@bowerswilkins.com>
+ return 0;
+}
+
+
static int wpa_supplicant_mesh_init(struct wpa_supplicant *wpa_s,
struct wpa_ssid *ssid,
@@ -291,35 +333,8 @@ static int wpa_supplicant_mesh_init(stru
struct hostapd_freq_params *freq)
@@ -156,9 +203,6 @@ static int wpa_supplicant_mesh_init(stru
struct hostapd_config *conf;
struct mesh_conf *mconf;
int basic_rates_erp[] = { 10, 20, 55, 60, 110, 120, 240, -1 };
- static int default_groups[] = { 19, 20, 21, 25, 26, -1 };
- const char *password;
- size_t len;
int rate_len;
int frequency;
@@ -291,38 +335,8 @@ static int wpa_supplicant_mesh_init(stru
return -1;
}
- if (mconf->security != MESH_CONF_SEC_NONE) {
- if (ssid->passphrase == NULL) {
- password = ssid->sae_password;
- if (!password)
- password = ssid->passphrase;
- if (!password) {
- wpa_printf(MSG_ERROR,
- "mesh: Passphrase for SAE not configured");
- goto out_free;
@ -90,9 +108,9 @@ Signed-off-by: Peter Oh <peter.oh@bowerswilkins.com>
- goto out_free;
- }
-
- len = os_strlen(ssid->passphrase);
- len = os_strlen(password);
- bss->conf->ssid.wpa_passphrase =
- dup_binstr(ssid->passphrase, len);
- dup_binstr(password, len);
-
- wpa_s->mesh_rsn = mesh_rsn_auth_init(wpa_s, mconf);
- if (!wpa_s->mesh_rsn)

View file

@ -1,7 +1,7 @@
From cbe8b9901f9cc254cbaa1ec1cee1c52af8f828bf Mon Sep 17 00:00:00 2001
From 95425b5becaeda8a515c942f417696e5df34bbc8 Mon Sep 17 00:00:00 2001
From: Peter Oh <peter.oh@bowerswilkins.com>
Date: Thu, 12 Apr 2018 02:49:00 -0700
Subject: [PATCH 03/15] mesh: relocate RSN init function
Date: Tue, 17 Apr 2018 21:55:00 -0700
Subject: [PATCH 03/16] mesh: relocate RSN init function
RSN init function should work together with mesh join
when it's used. Since mesh join could be called at different stage
@ -16,7 +16,7 @@ Signed-off-by: Peter Oh <peter.oh@bowerswilkins.com>
--- a/wpa_supplicant/mesh.c
+++ b/wpa_supplicant/mesh.c
@@ -333,9 +333,6 @@ static int wpa_supplicant_mesh_init(stru
@@ -335,9 +335,6 @@ static int wpa_supplicant_mesh_init(stru
return -1;
}
@ -26,7 +26,7 @@ Signed-off-by: Peter Oh <peter.oh@bowerswilkins.com>
wpa_supplicant_conf_ap_ht(wpa_s, ssid, conf);
return 0;
@@ -381,6 +378,12 @@ void wpas_join_mesh(struct wpa_supplican
@@ -383,6 +380,12 @@ void wpas_join_mesh(struct wpa_supplican
struct wpa_ssid *ssid = wpa_s->current_ssid;
int ret = 0;

View file

@ -1,7 +1,7 @@
From 8a4ebbb6bbbc1460c1d584d1a710bf1361797ffd Mon Sep 17 00:00:00 2001
From 32044a7bb26858bedaf147c77f49f5cef1133de3 Mon Sep 17 00:00:00 2001
From: Peter Oh <peter.oh@bowerswilkins.com>
Date: Thu, 12 Apr 2018 02:49:01 -0700
Subject: [PATCH 04/15] mesh: use setup completion callback to complete mesh
Date: Tue, 17 Apr 2018 21:55:01 -0700
Subject: [PATCH 04/16] mesh: use setup completion callback to complete mesh
join
mesh join function is the last function to be called during
@ -24,7 +24,7 @@ Signed-off-by: Peter Oh <peter.oh@bowerswilkins.com>
--- a/wpa_supplicant/mesh.c
+++ b/wpa_supplicant/mesh.c
@@ -215,6 +215,7 @@ static int wpa_supplicant_mesh_init(stru
@@ -217,6 +217,7 @@ static int wpa_supplicant_mesh_init(stru
if (!ifmsh)
return -ENOMEM;
@ -32,7 +32,7 @@ Signed-off-by: Peter Oh <peter.oh@bowerswilkins.com>
ifmsh->drv_flags = wpa_s->drv_flags;
ifmsh->num_bss = 1;
ifmsh->bss = os_calloc(wpa_s->ifmsh->num_bss,
@@ -231,6 +232,8 @@ static int wpa_supplicant_mesh_init(stru
@@ -233,6 +234,8 @@ static int wpa_supplicant_mesh_init(stru
bss->drv_priv = wpa_s->drv_priv;
bss->iface = ifmsh;
bss->mesh_sta_free_cb = mesh_mpm_free_sta;
@ -41,7 +41,7 @@ Signed-off-by: Peter Oh <peter.oh@bowerswilkins.com>
frequency = ssid->frequency;
if (frequency != freq->freq &&
frequency == freq->freq + freq->sec_channel_offset * 20) {
@@ -372,8 +375,9 @@ void wpa_supplicant_mesh_add_scan_ie(str
@@ -374,8 +377,9 @@ void wpa_supplicant_mesh_add_scan_ie(str
}
@ -52,7 +52,7 @@ Signed-off-by: Peter Oh <peter.oh@bowerswilkins.com>
struct wpa_driver_mesh_join_params *params = wpa_s->mesh_params;
struct wpa_ssid *ssid = wpa_s->current_ssid;
int ret = 0;
@@ -495,7 +499,6 @@ int wpa_supplicant_join_mesh(struct wpa_
@@ -497,7 +501,6 @@ int wpa_supplicant_join_mesh(struct wpa_
goto out;
}

View file

@ -1,7 +1,7 @@
From e223e851cbe776029a2768b56e7aa1a9f2873d09 Mon Sep 17 00:00:00 2001
From e2f13b1fac9799db83a37fc57df9471d9bb5b711 Mon Sep 17 00:00:00 2001
From: Peter Oh <peter.oh@bowerswilkins.com>
Date: Thu, 12 Apr 2018 02:49:02 -0700
Subject: [PATCH 05/15] mesh: reflect country setting to mesh configuration
Date: Tue, 17 Apr 2018 21:55:02 -0700
Subject: [PATCH 05/16] mesh: reflect country setting to mesh configuration
wpa_supplicant configuration has country parameter that is
supposed to be used in AP mode to indicate supporting 802.11h
@ -15,12 +15,13 @@ Signed-off-by: Peter Oh <peter.oh@bowerswilkins.com>
--- a/wpa_supplicant/mesh.c
+++ b/wpa_supplicant/mesh.c
@@ -252,6 +252,14 @@ static int wpa_supplicant_mesh_init(stru
@@ -254,6 +254,15 @@ static int wpa_supplicant_mesh_init(stru
bss->conf->start_disabled = 1;
bss->conf->mesh = MESH_ENABLED;
bss->conf->ap_max_inactivity = wpa_s->conf->mesh_max_inactivity;
+
+ if (ieee80211_is_dfs(ssid->frequency) && wpa_s->conf->country[0]) {
+ if (ieee80211_is_dfs(ssid->frequency, wpa_s->hw.modes,
+ wpa_s->hw.num_modes) && wpa_s->conf->country[0]) {
+ conf->ieee80211h = 1;
+ conf->ieee80211d = 1;
+ conf->country[0] = wpa_s->conf->country[0];

View file

@ -1,7 +1,7 @@
From c7f107e52205dd5fdb20f7ae13413b3673b0547e Mon Sep 17 00:00:00 2001
From 37bf08621eee53f30b464be71876c02e235077ba Mon Sep 17 00:00:00 2001
From: Peter Oh <peter.oh@bowerswilkins.com>
Date: Thu, 12 Apr 2018 02:49:03 -0700
Subject: [PATCH 06/15] mesh: inform kernel driver DFS handler in userspace
Date: Tue, 17 Apr 2018 21:55:03 -0700
Subject: [PATCH 06/16] 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
@ -26,7 +26,7 @@ Signed-off-by: Peter Oh <peter.oh@bowerswilkins.com>
/**
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
@@ -9244,6 +9244,9 @@ static int nl80211_join_mesh(struct i802
@@ -9270,6 +9270,9 @@ static int nl80211_join_mesh(struct i802
wpa_printf(MSG_DEBUG, " * flags=%08X", params->flags);
@ -38,7 +38,7 @@ Signed-off-by: Peter Oh <peter.oh@bowerswilkins.com>
goto fail;
--- a/wpa_supplicant/mesh.c
+++ b/wpa_supplicant/mesh.c
@@ -258,6 +258,7 @@ static int wpa_supplicant_mesh_init(stru
@@ -261,6 +261,7 @@ static int wpa_supplicant_mesh_init(stru
conf->ieee80211d = 1;
conf->country[0] = wpa_s->conf->country[0];
conf->country[1] = wpa_s->conf->country[1];

View file

@ -1,7 +1,7 @@
From a0c5eea22d5d1181dbe0861b24e4b9bb598f4e50 Mon Sep 17 00:00:00 2001
From 8190aab3344ae9746c897093f88f3679239d135d Mon Sep 17 00:00:00 2001
From: Peter Oh <peter.oh@bowerswilkins.com>
Date: Thu, 12 Apr 2018 02:49:04 -0700
Subject: [PATCH 07/15] mesh: apply channel attributes before running Mesh
Date: Tue, 17 Apr 2018 21:55:04 -0700
Subject: [PATCH 07/16] mesh: apply channel attributes before running Mesh
This helps mesh interface initializes with correct
channel parameters.
@ -13,7 +13,7 @@ Signed-off-by: Peter Oh <peter.oh@bowerswilkins.com>
--- a/wpa_supplicant/mesh.c
+++ b/wpa_supplicant/mesh.c
@@ -334,6 +334,8 @@ static int wpa_supplicant_mesh_init(stru
@@ -337,6 +337,8 @@ static int wpa_supplicant_mesh_init(stru
conf->basic_rates[rate_len] = -1;
}
@ -22,7 +22,7 @@ Signed-off-by: Peter Oh <peter.oh@bowerswilkins.com>
if (hostapd_setup_interface(ifmsh)) {
wpa_printf(MSG_ERROR,
"Failed to initialize hostapd interface for mesh");
@@ -345,8 +347,6 @@ static int wpa_supplicant_mesh_init(stru
@@ -348,8 +350,6 @@ static int wpa_supplicant_mesh_init(stru
return -1;
}

View file

@ -1,7 +1,7 @@
From 143809f1e60f749a5a5c72735ffa8eb99d602cc1 Mon Sep 17 00:00:00 2001
From e001251cb5708c406d477eca6aa912e5692b17fe Mon Sep 17 00:00:00 2001
From: Peter Oh <peter.oh@bowerswilkins.com>
Date: Thu, 12 Apr 2018 02:49:05 -0700
Subject: [PATCH 08/15] mesh: set interface type to mesh before setting
Date: Tue, 17 Apr 2018 21:55:05 -0700
Subject: [PATCH 08/16] mesh: set interface type to mesh before setting
interface
Correct interface type is required to start DFS CAC that can be
@ -14,7 +14,7 @@ Signed-off-by: Peter Oh <peter.oh@bowerswilkins.com>
--- a/wpa_supplicant/mesh.c
+++ b/wpa_supplicant/mesh.c
@@ -336,14 +336,14 @@ static int wpa_supplicant_mesh_init(stru
@@ -339,14 +339,14 @@ static int wpa_supplicant_mesh_init(stru
wpa_supplicant_conf_ap_ht(wpa_s, ssid, conf);

View file

@ -1,7 +1,7 @@
From 4347c97600f4484be8df804dfb5ed85b867d3c43 Mon Sep 17 00:00:00 2001
From 3cefd0bf495ad51a860b56281a8cae32bc4bd086 Mon Sep 17 00:00:00 2001
From: Peter Oh <peter.oh@bowerswilkins.com>
Date: Thu, 12 Apr 2018 02:49:06 -0700
Subject: [PATCH 09/15] mesh: set mesh center frequency
Date: Tue, 17 Apr 2018 21:55:06 -0700
Subject: [PATCH 09/16] mesh: set mesh center frequency
vht center frequency value is required to compose the correct channel info.
@ -12,7 +12,7 @@ Signed-off-by: Peter Oh <peter.oh@bowerswilkins.com>
--- a/wpa_supplicant/mesh.c
+++ b/wpa_supplicant/mesh.c
@@ -453,6 +453,7 @@ int wpa_supplicant_join_mesh(struct wpa_
@@ -456,6 +456,7 @@ int wpa_supplicant_join_mesh(struct wpa_
if (wpa_s->mesh_vht_enabled) {
ssid->vht = 1;

View file

@ -1,32 +1,33 @@
From d0a0e1030005834b99225feb64ec3794d31beab0 Mon Sep 17 00:00:00 2001
From 90aa570a894a907d11f85ced43a248198e24acc1 Mon Sep 17 00:00:00 2001
From: Peter Oh <peter.oh@bowerswilkins.com>
Date: Thu, 12 Apr 2018 02:49:07 -0700
Subject: [PATCH 10/15] mesh: consider mesh interface on dfs event handler
Date: Tue, 17 Apr 2018 21:55:07 -0700
Subject: [PATCH 10/16] mesh: consider mesh interface on dfs event handler
Once mesh starts supporting DFS channels, it has to handle DFS related events
from drivers, hence add mesh interface to the check list.
Signed-off-by: Peter Oh <peter.oh@bowerswilkins.com>
---
wpa_supplicant/ap.c | 55 ++++++++++++++++++++++++++++++++---------
wpa_supplicant/ap.c | 71 ++++++++++++++++++++++++++++++-----------
wpa_supplicant/events.c | 1 +
2 files changed, 44 insertions(+), 12 deletions(-)
2 files changed, 54 insertions(+), 18 deletions(-)
--- a/wpa_supplicant/ap.c
+++ b/wpa_supplicant/ap.c
@@ -1328,13 +1328,18 @@ int ap_ctrl_iface_chanswitch(struct wpa_
@@ -1337,13 +1337,18 @@ int ap_ctrl_iface_chanswitch(struct wpa_
void wpas_ap_ch_switch(struct wpa_supplicant *wpa_s, int freq, int ht,
int offset, int width, int cf1, int cf2)
{
+ struct hostapd_iface *iface = wpa_s->ap_iface;
+
if (!wpa_s->ap_iface)
- if (!wpa_s->ap_iface)
- return;
+ struct hostapd_iface *iface = wpa_s->ap_iface;
+ if (!wpa_s->ap_iface) {
+ if (!wpa_s->ifmsh)
+ return;
+ else
+ iface = wpa_s->ifmsh;
+ }
wpa_s->assoc_freq = freq;
if (wpa_s->current_ssid)
wpa_s->current_ssid->frequency = freq;
@ -35,91 +36,100 @@ Signed-off-by: Peter Oh <peter.oh@bowerswilkins.com>
offset, width, cf1, cf2);
}
@@ -1531,10 +1536,15 @@ int wpas_ap_pmksa_cache_add_external(str
@@ -1540,10 +1545,16 @@ int wpas_ap_pmksa_cache_add_external(str
void wpas_event_dfs_radar_detected(struct wpa_supplicant *wpa_s,
struct dfs_event *radar)
{
- if (!wpa_s->ap_iface || !wpa_s->ap_iface->bss[0])
- return;
+ struct hostapd_iface *iface = wpa_s->ap_iface;
+
if (!wpa_s->ap_iface || !wpa_s->ap_iface->bss[0])
- return;
+ if (!wpa_s->ap_iface || !wpa_s->ap_iface->bss[0]) {
+ if (!wpa_s->ifmsh || !wpa_s->ifmsh->bss[0])
+ return;
+ else
+ iface = wpa_s->ifmsh;
+ }
wpa_printf(MSG_DEBUG, "DFS radar detected on %d MHz", radar->freq);
- hostapd_dfs_radar_detected(wpa_s->ap_iface, radar->freq,
+ hostapd_dfs_radar_detected(iface, radar->freq,
radar->ht_enabled, radar->chan_offset,
radar->chan_width,
radar->cf1, radar->cf2);
@@ -1544,10 +1554,15 @@ void wpas_event_dfs_radar_detected(struc
@@ -1553,10 +1564,16 @@ void wpas_event_dfs_radar_detected(struc
void wpas_event_dfs_cac_started(struct wpa_supplicant *wpa_s,
struct dfs_event *radar)
{
- if (!wpa_s->ap_iface || !wpa_s->ap_iface->bss[0])
- return;
+ struct hostapd_iface *iface = wpa_s->ap_iface;
+
if (!wpa_s->ap_iface || !wpa_s->ap_iface->bss[0])
- return;
+ if (!wpa_s->ap_iface || !wpa_s->ap_iface->bss[0]) {
+ if (!wpa_s->ifmsh || !wpa_s->ifmsh->bss[0])
+ return;
+ else
+ iface = wpa_s->ifmsh;
+ }
wpa_printf(MSG_DEBUG, "DFS CAC started on %d MHz", radar->freq);
- hostapd_dfs_start_cac(wpa_s->ap_iface, radar->freq,
+ hostapd_dfs_start_cac(iface, radar->freq,
radar->ht_enabled, radar->chan_offset,
radar->chan_width, radar->cf1, radar->cf2);
}
@@ -1556,10 +1571,16 @@ void wpas_event_dfs_cac_started(struct w
@@ -1565,10 +1582,16 @@ void wpas_event_dfs_cac_started(struct w
void wpas_event_dfs_cac_finished(struct wpa_supplicant *wpa_s,
struct dfs_event *radar)
{
- if (!wpa_s->ap_iface || !wpa_s->ap_iface->bss[0])
- return;
+ struct hostapd_iface *iface = wpa_s->ap_iface;
+
if (!wpa_s->ap_iface || !wpa_s->ap_iface->bss[0])
- return;
+ if (!wpa_s->ap_iface || !wpa_s->ap_iface->bss[0]) {
+ if (!wpa_s->ifmsh || !wpa_s->ifmsh->bss[0])
+ return;
+ else
+ iface = wpa_s->ifmsh;
+
+ }
wpa_printf(MSG_DEBUG, "DFS CAC finished on %d MHz", radar->freq);
- hostapd_dfs_complete_cac(wpa_s->ap_iface, 1, radar->freq,
+ hostapd_dfs_complete_cac(iface, 1, radar->freq,
radar->ht_enabled, radar->chan_offset,
radar->chan_width, radar->cf1, radar->cf2);
}
@@ -1568,10 +1589,15 @@ void wpas_event_dfs_cac_finished(struct
@@ -1577,10 +1600,16 @@ void wpas_event_dfs_cac_finished(struct
void wpas_event_dfs_cac_aborted(struct wpa_supplicant *wpa_s,
struct dfs_event *radar)
{
- if (!wpa_s->ap_iface || !wpa_s->ap_iface->bss[0])
- return;
+ struct hostapd_iface *iface = wpa_s->ap_iface;
+
if (!wpa_s->ap_iface || !wpa_s->ap_iface->bss[0])
- return;
+ if (!wpa_s->ap_iface || !wpa_s->ap_iface->bss[0]) {
+ if (!wpa_s->ifmsh || !wpa_s->ifmsh->bss[0])
+ return;
+ else
+ iface = wpa_s->ifmsh;
+ }
wpa_printf(MSG_DEBUG, "DFS CAC aborted on %d MHz", radar->freq);
- hostapd_dfs_complete_cac(wpa_s->ap_iface, 0, radar->freq,
+ hostapd_dfs_complete_cac(iface, 0, radar->freq,
radar->ht_enabled, radar->chan_offset,
radar->chan_width, radar->cf1, radar->cf2);
}
@@ -1580,10 +1606,15 @@ void wpas_event_dfs_cac_aborted(struct w
@@ -1589,10 +1618,16 @@ void wpas_event_dfs_cac_aborted(struct w
void wpas_event_dfs_cac_nop_finished(struct wpa_supplicant *wpa_s,
struct dfs_event *radar)
{
- if (!wpa_s->ap_iface || !wpa_s->ap_iface->bss[0])
- return;
+ struct hostapd_iface *iface = wpa_s->ap_iface;
+
if (!wpa_s->ap_iface || !wpa_s->ap_iface->bss[0])
- return;
+ if (!wpa_s->ap_iface || !wpa_s->ap_iface->bss[0]) {
+ if (!wpa_s->ifmsh || !wpa_s->ifmsh->bss[0])
+ return;
+ else
+ iface = wpa_s->ifmsh;
+ }
wpa_printf(MSG_DEBUG, "DFS NOP finished on %d MHz", radar->freq);
- hostapd_dfs_nop_finished(wpa_s->ap_iface, radar->freq,
+ hostapd_dfs_nop_finished(iface, radar->freq,
@ -128,8 +138,8 @@ Signed-off-by: Peter Oh <peter.oh@bowerswilkins.com>
}
--- a/wpa_supplicant/events.c
+++ b/wpa_supplicant/events.c
@@ -4168,6 +4168,7 @@ void wpa_supplicant_event(void *ctx, enu
@@ -4203,6 +4203,7 @@ void wpa_supplicant_event(void *ctx, enu
#ifdef CONFIG_AP
if (wpa_s->current_ssid->mode == WPAS_MODE_AP ||
wpa_s->current_ssid->mode == WPAS_MODE_P2P_GO ||
+ wpa_s->current_ssid->mode == WPAS_MODE_MESH ||

View file

@ -1,7 +1,7 @@
From e7fc5d2e6b34102282ff94a6e5255af4b6e9ccb5 Mon Sep 17 00:00:00 2001
From ce3e491e445ebea9705e76ac7ee3d4841ace1cad Mon Sep 17 00:00:00 2001
From: Peter Oh <peter.oh@bowerswilkins.com>
Date: Thu, 12 Apr 2018 02:49:08 -0700
Subject: [PATCH 11/15] mesh: Allow DFS channels to be selected if dfs is
Date: Tue, 17 Apr 2018 21:55:08 -0700
Subject: [PATCH 11/16] 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

View file

@ -1,7 +1,7 @@
From 851f67301a8b9bc96c3d8cce08e355a64d30350d Mon Sep 17 00:00:00 2001
From 912b5c89328f1f9585e64fd13460928c71f28352 Mon Sep 17 00:00:00 2001
From: Peter Oh <peter.oh@bowerswilkins.com>
Date: Thu, 12 Apr 2018 02:49:09 -0700
Subject: [PATCH 12/15] mesh: allow mesh to send channel switch request
Date: Tue, 17 Apr 2018 21:55:09 -0700
Subject: [PATCH 12/16] mesh: allow mesh to send channel switch request
add mesh type to nl80211 channel switch request,
so mesh is able to send the request to kernel drivers.
@ -13,7 +13,7 @@ Signed-off-by: Peter Oh <peter.oh@bowerswilkins.com>
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
@@ -8659,7 +8659,8 @@ static int nl80211_switch_channel(void *
@@ -8685,7 +8685,8 @@ static int nl80211_switch_channel(void *
}
if ((drv->nlmode != NL80211_IFTYPE_AP) &&

View file

@ -1,7 +1,7 @@
From 5fe4fa1c1f426d81496458d2127bfbd7623fe5d5 Mon Sep 17 00:00:00 2001
From d7ae7271dce4203bfcd79a230acb24f03f38633d Mon Sep 17 00:00:00 2001
From: Peter Oh <peter.oh@bowerswilkins.com>
Date: Thu, 12 Apr 2018 02:49:10 -0700
Subject: [PATCH 13/15] mesh: do not allow pri/sec channel switch
Date: Tue, 17 Apr 2018 21:55:10 -0700
Subject: [PATCH 13/16] mesh: do not allow pri/sec channel switch
We don't want mesh to switch the channel from primary to secondary,
since mesh points are not able to join each other in that case.
@ -13,7 +13,7 @@ Signed-off-by: Peter Oh <peter.oh@bowerswilkins.com>
--- a/wpa_supplicant/mesh.c
+++ b/wpa_supplicant/mesh.c
@@ -333,7 +333,10 @@ static int wpa_supplicant_mesh_init(stru
@@ -336,7 +336,10 @@ static int wpa_supplicant_mesh_init(stru
rate_len * sizeof(int));
conf->basic_rates[rate_len] = -1;
}

View file

@ -1,7 +1,7 @@
From fcc5fe675d1155d65df0471aa06f746c28b66b6c Mon Sep 17 00:00:00 2001
From cf2ba81fb307f3e87e13896f9dbf93c0c2a9eb92 Mon Sep 17 00:00:00 2001
From: Peter Oh <peter.oh@bowerswilkins.com>
Date: Thu, 12 Apr 2018 02:49:11 -0700
Subject: [PATCH 14/15] mesh: do not allow scan result to swap pri/sec
Date: Tue, 17 Apr 2018 21:55:11 -0700
Subject: [PATCH 14/16] mesh: do not allow scan result to swap pri/sec
Swapping between primary and secondary channel will break
mesh from joining, hence don't allow it.

View file

@ -1,7 +1,7 @@
From ab2ba9fd9ac73c83dc15a6d76d93df4434d539d6 Mon Sep 17 00:00:00 2001
From 48f31256ffebfc43d6b14b93597aa2c7e2975dc4 Mon Sep 17 00:00:00 2001
From: Peter Oh <peter.oh@bowerswilkins.com>
Date: Thu, 12 Apr 2018 02:49:12 -0700
Subject: [PATCH 15/15] mesh: do not use offchan mgmt tx on DFS
Date: Tue, 17 Apr 2018 21:55:12 -0700
Subject: [PATCH 15/16] mesh: do not use offchan mgmt tx on DFS
Drivers don't allow mesh to use offchannel on management Tx.
@ -12,24 +12,31 @@ Signed-off-by: Peter Oh <peter.oh@bowerswilkins.com>
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
@@ -7148,6 +7148,7 @@ static int wpa_driver_nl80211_send_actio
@@ -7165,6 +7165,10 @@ static int wpa_driver_nl80211_send_actio
struct wpa_driver_nl80211_data *drv = bss->drv;
int ret = -1;
u8 *buf;
+ int offchanok = 1;
+ u16 num_modes, flags;
+ struct hostapd_hw_modes *modes;
+ u8 dfs_domain;
struct ieee80211_hdr *hdr;
wpa_printf(MSG_DEBUG, "nl80211: Send Action frame (ifindex=%d, "
@@ -7173,6 +7174,8 @@ static int wpa_driver_nl80211_send_actio
@@ -7190,6 +7194,12 @@ static int wpa_driver_nl80211_send_actio
os_memset(bss->rand_addr, 0, ETH_ALEN);
}
+ if (is_mesh_interface(drv->nlmode) && ieee80211_is_dfs(freq))
+ if (is_mesh_interface(drv->nlmode) &&
+ (modes = nl80211_get_hw_feature_data(bss, &num_modes, &flags,
+ &dfs_domain)) &&
+ ieee80211_is_dfs(freq, modes, num_modes))
+ offchanok = 0;
+
if (is_ap_interface(drv->nlmode) &&
(!(drv->capa.flags & WPA_DRIVER_FLAGS_OFFCHANNEL_TX) ||
(int) freq == bss->freq || drv->device_ap_sme ||
@@ -7184,7 +7187,7 @@ static int wpa_driver_nl80211_send_actio
@@ -7201,7 +7211,7 @@ static int wpa_driver_nl80211_send_actio
ret = nl80211_send_frame_cmd(bss, freq, wait_time, buf,
24 + data_len,
&drv->send_action_cookie,

View file

@ -1,10 +1,7 @@
From d11881c1ad0d6a102962d1a040a398f597256ae0 Mon Sep 17 00:00:00 2001
From 9a01d7f21bd33725dc33325a437c3cc4185ee8bd 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
To: hostap@lists.infradead.org
Cc: Jouni Malinen <j@w1.fi>,
Johannes Berg <johannes.berg@intel.com>
Subject: [PATCH 16/16] 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
@ -16,13 +13,13 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
src/drivers/driver.h | 2 ++
src/drivers/driver_nl80211.c | 3 +++
wpa_supplicant/config.c | 4 ++++
wpa_supplicant/config.h | 3 +++
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 | 6 ++++++
10 files changed, 37 insertions(+), 2 deletions(-)
wpa_supplicant/wpa_supplicant.conf | 3 +++
10 files changed, 40 insertions(+), 2 deletions(-)
--- a/src/ap/ap_config.h
+++ b/src/ap/ap_config.h
@ -34,7 +31,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
};
#define MAX_STA_COUNT 2007
@@ -612,6 +613,7 @@ struct hostapd_bss_config {
@@ -618,6 +619,7 @@ struct hostapd_bss_config {
#define MESH_ENABLED BIT(0)
int mesh;
@ -62,7 +59,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
@@ -9197,6 +9197,9 @@ static int nl80211_put_mesh_config(struc
@@ -9230,6 +9230,9 @@ static int nl80211_put_mesh_config(struc
if (((params->flags & WPA_DRIVER_MESH_CONF_FLAG_AUTO_PLINKS) &&
nla_put_u8(msg, NL80211_MESHCONF_AUTO_OPEN_PLINKS,
params->auto_plinks)) ||
@ -82,7 +79,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
{ INT_RANGE(mesh_rssi_threshold, -255, 1) },
#else /* CONFIG_MESH */
{ INT_RANGE(mode, 0, 4) },
@@ -2757,6 +2758,7 @@ void wpa_config_set_network_defaults(str
@@ -2761,6 +2762,7 @@ void wpa_config_set_network_defaults(str
ssid->dot11MeshRetryTimeout = DEFAULT_MESH_RETRY_TIMEOUT;
ssid->dot11MeshConfirmTimeout = DEFAULT_MESH_CONFIRM_TIMEOUT;
ssid->dot11MeshHoldingTimeout = DEFAULT_MESH_HOLDING_TIMEOUT;
@ -90,7 +87,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
ssid->mesh_rssi_threshold = DEFAULT_MESH_RSSI_THRESHOLD;
#endif /* CONFIG_MESH */
#ifdef CONFIG_HT_OVERRIDES
@@ -3886,6 +3888,7 @@ struct wpa_config * wpa_config_alloc_emp
@@ -3976,6 +3978,7 @@ struct wpa_config * wpa_config_alloc_emp
config->user_mpm = DEFAULT_USER_MPM;
config->max_peer_links = DEFAULT_MAX_PEER_LINKS;
config->mesh_max_inactivity = DEFAULT_MESH_MAX_INACTIVITY;
@ -98,7 +95,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
config->dot11RSNASAERetransPeriod =
DEFAULT_DOT11_RSNA_SAE_RETRANS_PERIOD;
config->fast_reauth = DEFAULT_FAST_REAUTH;
@@ -4508,6 +4511,7 @@ static const struct global_parse_data gl
@@ -4598,6 +4601,7 @@ static const struct global_parse_data gl
{ INT(user_mpm), 0 },
{ INT_RANGE(max_peer_links, 0, 255), 0 },
{ INT(mesh_max_inactivity), 0 },
@ -116,18 +113,24 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
/*
* The default dot11RSNASAERetransPeriod is defined as 40 ms in the standard,
* but use 1000 ms in practice to avoid issues on low power CPUs.
@@ -1269,6 +1270,8 @@ struct wpa_config {
*/
@@ -1306,6 +1307,14 @@ struct wpa_config {
int mesh_max_inactivity;
/**
+ * mesh_fwding - Mesh network layer-2 forwarding
+ *
+ * This controls whether to enable layer-2 forwarding.
+ * By default: 1: enabled
+ */
+ int mesh_fwding;
+
/**
+ /**
* dot11RSNASAERetransPeriod - Timeout to retransmit SAE Auth frame
*
* This timeout value is used in mesh STA to retransmit
--- a/wpa_supplicant/config_file.c
+++ b/wpa_supplicant/config_file.c
@@ -816,6 +816,7 @@ static void wpa_config_write_network(FIL
@@ -817,6 +817,7 @@ static void wpa_config_write_network(FIL
#endif /* IEEE8021X_EAPOL */
INT(mode);
INT(no_auto_peer);
@ -135,7 +138,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
INT(frequency);
INT(fixed_freq);
#ifdef CONFIG_ACS
@@ -1433,6 +1434,9 @@ static void wpa_config_write_global(FILE
@@ -1449,6 +1450,9 @@ static void wpa_config_write_global(FILE
fprintf(f, "mesh_max_inactivity=%d\n",
config->mesh_max_inactivity);
@ -161,7 +164,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
--- a/wpa_supplicant/mesh.c
+++ b/wpa_supplicant/mesh.c
@@ -121,6 +121,7 @@ static struct mesh_conf * mesh_config_cr
@@ -120,6 +120,7 @@ static struct mesh_conf * mesh_config_cr
conf->mesh_cc_id = 0;
conf->mesh_sp_id = MESH_SYNC_METHOD_NEIGHBOR_OFFSET;
conf->mesh_auth_id = (conf->security & MESH_CONF_SEC_AUTH) ? 1 : 0;
@ -169,15 +172,15 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
conf->dot11MeshMaxRetries = ssid->dot11MeshMaxRetries;
conf->dot11MeshRetryTimeout = ssid->dot11MeshRetryTimeout;
conf->dot11MeshConfirmTimeout = ssid->dot11MeshConfirmTimeout;
@@ -256,6 +257,7 @@ static int wpa_supplicant_mesh_init(stru
@@ -254,6 +255,7 @@ static int wpa_supplicant_mesh_init(stru
bss->conf->start_disabled = 1;
bss->conf->mesh = MESH_ENABLED;
bss->conf->ap_max_inactivity = wpa_s->conf->mesh_max_inactivity;
+ bss->conf->mesh_fwding = wpa_s->conf->mesh_fwding;
if (ieee80211_is_dfs(ssid->frequency) && wpa_s->conf->country[0]) {
conf->ieee80211h = 1;
@@ -508,6 +510,10 @@ int wpa_supplicant_join_mesh(struct wpa_
if (ieee80211_is_dfs(ssid->frequency, wpa_s->hw.modes,
wpa_s->hw.num_modes) && wpa_s->conf->country[0]) {
@@ -507,6 +509,10 @@ int wpa_supplicant_join_mesh(struct wpa_
}
params->conf.peer_link_timeout = wpa_s->conf->mesh_max_inactivity;
@ -204,15 +207,12 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
wpabuf_put_u8(buf, WLAN_EID_MESH_ID);
--- a/wpa_supplicant/wpa_supplicant.conf
+++ b/wpa_supplicant/wpa_supplicant.conf
@@ -153,6 +153,12 @@ ap_scan=1
@@ -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
+
+# Accept additional peer links
+#mesh_auto_open_plinks=1
+
# cert_in_cb - Whether to include a peer certificate dump in events
# This controls whether peer certificates for authentication server and

View file

@ -1,52 +0,0 @@
From 30c1693f42326d4f927e76120492bc9593b8f739 Mon Sep 17 00:00:00 2001
From: Daniel Golle <daniel@makrotopia.org>
Date: Fri, 13 Apr 2018 00:42:10 +0200
Subject: [PATCH] mesh: properly handle sae_password
The recently introduced sae_password parameter is only handled properly
in wpa_supplicant/sme.c while wpa_supplicant/mesh.c assumed that
ssid->passphrase exclusively holds the secret.
Import the logic from sme.c to mesh.c to allow having only sae_password
set which otherwise throws this error:
AP-ENABLED
mesh: Passphrase for SAE not configured
Init RSN failed. Deinit mesh...
wlan1: interface state ENABLED->DISABLED
AP-DISABLED
Segmentation fault
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
---
wpa_supplicant/mesh.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
--- a/wpa_supplicant/mesh.c
+++ b/wpa_supplicant/mesh.c
@@ -154,10 +154,14 @@ int wpas_mesh_init_rsn(struct wpa_suppli
struct wpa_ssid *ssid = wpa_s->current_ssid;
struct hostapd_data *bss = ifmsh->bss[0];
static int default_groups[] = { 19, 20, 21, 25, 26, -1 };
+ const char *password;
size_t len;
if (mconf->security != MESH_CONF_SEC_NONE) {
- if (ssid->passphrase == NULL) {
+ password = ssid->sae_password;
+ if (!password)
+ password = ssid->passphrase;
+ if (!password) {
wpa_printf(MSG_ERROR,
"mesh: Passphrase for SAE not configured");
return -1;
@@ -177,9 +181,9 @@ int wpas_mesh_init_rsn(struct wpa_suppli
return -1;
}
- len = os_strlen(ssid->passphrase);
+ len = os_strlen(password);
bss->conf->ssid.wpa_passphrase =
- dup_binstr(ssid->passphrase, len);
+ dup_binstr(password, len);
wpa_s->mesh_rsn = mesh_rsn_auth_init(wpa_s, mconf);
if (!wpa_s->mesh_rsn)

View file

@ -12,7 +12,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
--- a/wpa_supplicant/mesh.c
+++ b/wpa_supplicant/mesh.c
@@ -216,7 +216,7 @@ static int wpa_supplicant_mesh_init(stru
@@ -214,7 +214,7 @@ static int wpa_supplicant_mesh_init(stru
return 0;
}

View file

@ -1,21 +0,0 @@
--- a/src/rsn_supp/pmksa_cache.h
+++ b/src/rsn_supp/pmksa_cache.h
@@ -101,7 +101,7 @@ static inline void pmksa_cache_deinit(st
static inline struct rsn_pmksa_cache_entry *
pmksa_cache_get(struct rsn_pmksa_cache *pmksa, const u8 *aa, const u8 *pmkid,
- const void *network_ctx)
+ const void *network_ctx, int akmp)
{
return NULL;
}
@@ -148,7 +148,8 @@ static inline int pmksa_cache_set_curren
const u8 *bssid,
void *network_ctx,
int try_opportunistic,
- const u8 *fils_cache_id)
+ const u8 *fils_cache_id,
+ int akmp)
{
return -1;
}

View file

@ -17,7 +17,7 @@ Signed-off-by: Peter Oh <peter.oh@bowerswilkins.com>
--- a/wpa_supplicant/config.c
+++ b/wpa_supplicant/config.c
@@ -2796,6 +2796,7 @@ void wpa_config_set_network_defaults(str
@@ -2800,6 +2800,7 @@ void wpa_config_set_network_defaults(str
ssid->mka_priority = DEFAULT_PRIO_NOT_KEY_SERVER;
#endif /* CONFIG_MACSEC */
ssid->mac_addr = -1;

View file

@ -36,7 +36,7 @@
LIBS += $(DRV_AP_LIBS)
ifdef CONFIG_L2_PACKET
@@ -1270,6 +1276,12 @@ install: $(addprefix $(DESTDIR)$(BINDIR)
@@ -1274,6 +1280,12 @@ install: $(addprefix $(DESTDIR)$(BINDIR)
BCHECK=../src/drivers/build.hostapd
@ -49,7 +49,7 @@
hostapd: $(BCHECK) $(OBJS)
$(Q)$(CC) $(LDFLAGS) -o hostapd $(OBJS) $(LIBS)
@$(E) " LD " $@
@@ -1315,6 +1327,12 @@ ifeq ($(CONFIG_TLS), linux)
@@ -1316,6 +1328,12 @@ ifeq ($(CONFIG_TLS), linux)
HOBJS += ../src/crypto/crypto_linux.o
endif
@ -128,7 +128,7 @@
NEED_AES_WRAP=y
OBJS += ../src/ap/wpa_auth.o
OBJS += ../src/ap/wpa_auth_ie.o
@@ -1887,6 +1904,12 @@ wpa_priv: $(BCHECK) $(OBJS_priv)
@@ -1888,6 +1905,12 @@ wpa_priv: $(BCHECK) $(OBJS_priv)
$(OBJS_c) $(OBJS_t) $(OBJS_t2) $(OBJS) $(BCHECK) $(EXTRA_progs): .config
@ -141,7 +141,7 @@
wpa_supplicant: $(BCHECK) $(OBJS) $(EXTRA_progs)
$(Q)$(LDO) $(LDFLAGS) -o wpa_supplicant $(OBJS) $(LIBS) $(EXTRALIBS)
@$(E) " LD " $@
@@ -1989,6 +2012,12 @@ endif
@@ -1990,6 +2013,12 @@ endif
-e 's|\@DBUS_INTERFACE\@|$(DBUS_INTERFACE)|g' $< >$@
@$(E) " sed" $<
@ -156,7 +156,7 @@
wpa_cli.exe: wpa_cli
--- a/src/drivers/driver.h
+++ b/src/drivers/driver.h
@@ -5430,8 +5430,8 @@ union wpa_event_data {
@@ -5449,8 +5449,8 @@ union wpa_event_data {
* Driver wrapper code should call this function whenever an event is received
* from the driver.
*/
@ -167,7 +167,7 @@
/**
* wpa_supplicant_event_global - Report a driver event for wpa_supplicant
@@ -5443,7 +5443,7 @@ void wpa_supplicant_event(void *ctx, enu
@@ -5462,7 +5462,7 @@ void wpa_supplicant_event(void *ctx, enu
* Same as wpa_supplicant_event(), but we search for the interface in
* wpa_global.
*/
@ -178,8 +178,8 @@
/*
--- a/src/ap/drv_callbacks.c
+++ b/src/ap/drv_callbacks.c
@@ -1473,8 +1473,8 @@ static void hostapd_event_dfs_cac_starte
#endif /* NEED_AP_MLME */
@@ -1515,8 +1515,8 @@ static void hostapd_event_wds_sta_interf
}
-void wpa_supplicant_event(void *ctx, enum wpa_event_type event,
@ -189,7 +189,7 @@
{
struct hostapd_data *hapd = ctx;
#ifndef CONFIG_NO_STDOUT_DEBUG
@@ -1694,7 +1694,7 @@ void wpa_supplicant_event(void *ctx, enu
@@ -1742,7 +1742,7 @@ void wpa_supplicant_event(void *ctx, enu
}
@ -231,7 +231,7 @@
os_memset(&global, 0, sizeof(global));
--- a/wpa_supplicant/events.c
+++ b/wpa_supplicant/events.c
@@ -3812,8 +3812,8 @@ static void wpa_supplicant_event_assoc_a
@@ -3901,8 +3901,8 @@ static void wpas_event_assoc_reject(stru
}
@ -242,7 +242,7 @@
{
struct wpa_supplicant *wpa_s = ctx;
int resched;
@@ -4632,7 +4632,7 @@ void wpa_supplicant_event(void *ctx, enu
@@ -4669,7 +4669,7 @@ void wpa_supplicant_event(void *ctx, enu
}
@ -253,7 +253,7 @@
struct wpa_supplicant *wpa_s;
--- a/wpa_supplicant/wpa_supplicant.c
+++ b/wpa_supplicant/wpa_supplicant.c
@@ -5736,7 +5736,6 @@ struct wpa_interface * wpa_supplicant_ma
@@ -5770,7 +5770,6 @@ struct wpa_interface * wpa_supplicant_ma
return NULL;
}
@ -261,7 +261,7 @@
/**
* wpa_supplicant_match_existing - Match existing interfaces
* @global: Pointer to global data from wpa_supplicant_init()
@@ -5773,6 +5772,11 @@ static int wpa_supplicant_match_existing
@@ -5807,6 +5806,11 @@ static int wpa_supplicant_match_existing
#endif /* CONFIG_MATCH_IFACE */
@ -273,7 +273,7 @@
/**
* wpa_supplicant_add_iface - Add a new network interface
@@ -6029,6 +6033,8 @@ struct wpa_global * wpa_supplicant_init(
@@ -6063,6 +6067,8 @@ struct wpa_global * wpa_supplicant_init(
#ifndef CONFIG_NO_WPA_MSG
wpa_msg_register_ifname_cb(wpa_supplicant_msg_ifname_cb);
#endif /* CONFIG_NO_WPA_MSG */

View file

@ -1,6 +1,6 @@
--- a/hostapd/config_file.c
+++ b/hostapd/config_file.c
@@ -3131,6 +3131,10 @@ static int hostapd_config_fill(struct ho
@@ -3159,6 +3159,10 @@ static int hostapd_config_fill(struct ho
}
#endif /* CONFIG_IEEE80211W */
#ifdef CONFIG_IEEE80211N
@ -13,7 +13,7 @@
} else if (os_strcmp(buf, "ht_capab") == 0) {
--- a/src/ap/ap_config.h
+++ b/src/ap/ap_config.h
@@ -763,6 +763,8 @@ struct hostapd_config {
@@ -769,6 +769,8 @@ struct hostapd_config {
int ht_op_mode_fixed;
u16 ht_capab;

View file

@ -10,7 +10,7 @@
{ STR(id_str) },
--- a/wpa_supplicant/config_file.c
+++ b/wpa_supplicant/config_file.c
@@ -816,6 +816,7 @@ static void wpa_config_write_network(FIL
@@ -817,6 +817,7 @@ static void wpa_config_write_network(FIL
#endif /* IEEE8021X_EAPOL */
INT(mode);
INT(no_auto_peer);
@ -20,7 +20,7 @@
INT(fixed_freq);
--- a/wpa_supplicant/mesh.c
+++ b/wpa_supplicant/mesh.c
@@ -287,6 +287,8 @@ static int wpa_supplicant_mesh_init(stru
@@ -286,6 +286,8 @@ static int wpa_supplicant_mesh_init(stru
frequency);
goto out_free;
}
@ -57,7 +57,7 @@
for (chan_idx = 0; chan_idx < mode->num_channels; chan_idx++) {
--- a/wpa_supplicant/config_ssid.h
+++ b/wpa_supplicant/config_ssid.h
@@ -835,6 +835,8 @@ struct wpa_ssid {
@@ -848,6 +848,8 @@ struct wpa_ssid {
*/
int no_auto_peer;

View file

@ -1,6 +1,6 @@
--- a/wpa_supplicant/wpa_supplicant.c
+++ b/wpa_supplicant/wpa_supplicant.c
@@ -4187,7 +4187,7 @@ wpa_supplicant_alloc(struct wpa_supplica
@@ -4221,7 +4221,7 @@ wpa_supplicant_alloc(struct wpa_supplica
if (wpa_s == NULL)
return NULL;
wpa_s->scan_req = INITIAL_SCAN_REQ;

View file

@ -1,6 +1,6 @@
--- a/src/ap/hostapd.c
+++ b/src/ap/hostapd.c
@@ -90,6 +90,25 @@ static void hostapd_reload_bss(struct ho
@@ -93,6 +93,25 @@ static void hostapd_reload_bss(struct ho
#endif /* CONFIG_NO_RADIUS */
ssid = &hapd->conf->ssid;
@ -26,7 +26,7 @@
if (!ssid->wpa_psk_set && ssid->wpa_psk && !ssid->wpa_psk->next &&
ssid->wpa_passphrase_set && ssid->wpa_passphrase) {
/*
@@ -168,6 +187,7 @@ int hostapd_reload_config(struct hostapd
@@ -171,6 +190,7 @@ int hostapd_reload_config(struct hostapd
struct hostapd_data *hapd = iface->bss[0];
struct hostapd_config *newconf, *oldconf;
size_t j;
@ -34,7 +34,7 @@
if (iface->config_fname == NULL) {
/* Only in-memory config in use - assume it has been updated */
@@ -189,21 +209,20 @@ int hostapd_reload_config(struct hostapd
@@ -192,21 +212,20 @@ int hostapd_reload_config(struct hostapd
oldconf = hapd->iconf;
iface->conf = newconf;

View file

@ -27,7 +27,7 @@
}
@@ -7040,8 +7045,6 @@ static int wpa_driver_nl80211_if_remove(
@@ -7057,8 +7062,6 @@ static int wpa_driver_nl80211_if_remove(
} else {
wpa_printf(MSG_DEBUG, "nl80211: First BSS - reassign context");
nl80211_teardown_ap(bss);
@ -36,7 +36,7 @@
nl80211_destroy_bss(bss);
if (!bss->added_if)
i802_set_iface_flags(bss, 0);
@@ -7415,7 +7418,6 @@ static int wpa_driver_nl80211_deinit_ap(
@@ -7439,7 +7442,6 @@ static int wpa_driver_nl80211_deinit_ap(
if (!is_ap_interface(drv->nlmode))
return -1;
wpa_driver_nl80211_del_beacon(bss);
@ -44,7 +44,7 @@
/*
* If the P2P GO interface was dynamically added, then it is
@@ -7435,7 +7437,6 @@ static int wpa_driver_nl80211_stop_ap(vo
@@ -7459,7 +7461,6 @@ static int wpa_driver_nl80211_stop_ap(vo
if (!is_ap_interface(drv->nlmode))
return -1;
wpa_driver_nl80211_del_beacon(bss);

View file

@ -78,7 +78,7 @@
#ifdef CONFIG_IEEE80211W
#ifdef NEED_AP_MLME
@@ -3026,6 +3083,8 @@ static int hostapd_ctrl_iface_receive_pr
@@ -3031,6 +3088,8 @@ static int hostapd_ctrl_iface_receive_pr
} else if (os_strncmp(buf, "VENDOR ", 7) == 0) {
reply_len = hostapd_ctrl_iface_vendor(hapd, buf + 7, reply,
reply_size);
@ -89,7 +89,7 @@
#ifdef RADIUS_SERVER
--- a/src/ap/ctrl_iface_ap.c
+++ b/src/ap/ctrl_iface_ap.c
@@ -857,7 +857,13 @@ int hostapd_parse_csa_settings(const cha
@@ -864,7 +864,13 @@ int hostapd_parse_csa_settings(const cha
int hostapd_ctrl_iface_stop_ap(struct hostapd_data *hapd)
{

View file

@ -30,7 +30,7 @@
#include "drivers/driver.h"
#include "eap_peer/eap.h"
#include "wpa_supplicant_i.h"
@@ -290,6 +291,10 @@ void calculate_update_time(const struct
@@ -292,6 +293,10 @@ void calculate_update_time(const struct
static void wpa_bss_copy_res(struct wpa_bss *dst, struct wpa_scan_res *src,
struct os_reltime *fetch_time)
{
@ -41,7 +41,7 @@
dst->flags = src->flags;
os_memcpy(dst->bssid, src->bssid, ETH_ALEN);
dst->freq = src->freq;
@@ -302,6 +307,15 @@ static void wpa_bss_copy_res(struct wpa_
@@ -304,6 +309,15 @@ static void wpa_bss_copy_res(struct wpa_
dst->est_throughput = src->est_throughput;
dst->snr = src->snr;
@ -59,7 +59,7 @@
--- a/wpa_supplicant/bss.h
+++ b/wpa_supplicant/bss.h
@@ -80,6 +80,10 @@ struct wpa_bss {
@@ -81,6 +81,10 @@ struct wpa_bss {
u8 ssid[SSID_MAX_LEN];
/** Length of SSID */
size_t ssid_len;
@ -192,7 +192,7 @@
#else /* CONFIG_MESH */
wpa_msg(wpa_s, MSG_ERROR,
"mesh mode support not included in the build");
@@ -5362,6 +5417,16 @@ static int wpa_supplicant_init_iface(str
@@ -5396,6 +5451,16 @@ static int wpa_supplicant_init_iface(str
sizeof(wpa_s->bridge_ifname));
}
@ -209,7 +209,7 @@
/* RSNA Supplicant Key Management - INITIALIZE */
eapol_sm_notify_portEnabled(wpa_s->eapol, FALSE);
eapol_sm_notify_portValid(wpa_s->eapol, FALSE);
@@ -5683,6 +5748,11 @@ static void wpa_supplicant_deinit_iface(
@@ -5717,6 +5782,11 @@ static void wpa_supplicant_deinit_iface(
if (terminate)
wpa_msg(wpa_s, MSG_INFO, WPA_EVENT_TERMINATING);

View file

@ -12,7 +12,7 @@
else
--- a/hostapd/ctrl_iface.c
+++ b/hostapd/ctrl_iface.c
@@ -2852,6 +2852,7 @@ static int hostapd_ctrl_iface_receive_pr
@@ -2857,6 +2857,7 @@ static int hostapd_ctrl_iface_receive_pr
reply_size);
} else if (os_strcmp(buf, "STATUS-DRIVER") == 0) {
reply_len = hostapd_drv_status(hapd, reply, reply_size);
@ -20,7 +20,7 @@
} else if (os_strcmp(buf, "MIB") == 0) {
reply_len = ieee802_11_get_mib(hapd, reply, reply_size);
if (reply_len >= 0) {
@@ -2893,6 +2894,7 @@ static int hostapd_ctrl_iface_receive_pr
@@ -2898,6 +2899,7 @@ static int hostapd_ctrl_iface_receive_pr
} else if (os_strncmp(buf, "STA-NEXT ", 9) == 0) {
reply_len = hostapd_ctrl_iface_sta_next(hapd, buf + 9, reply,
reply_size);
@ -51,7 +51,7 @@
if (wpa_s->ap_iface) {
pos += ap_ctrl_iface_wpa_get_status(wpa_s, pos,
end - pos,
@@ -9809,6 +9809,7 @@ char * wpa_supplicant_ctrl_iface_process
@@ -9825,6 +9825,7 @@ char * wpa_supplicant_ctrl_iface_process
reply_len = -1;
} else if (os_strncmp(buf, "NOTE ", 5) == 0) {
wpa_printf(MSG_INFO, "NOTE: %s", buf + 5);
@ -59,7 +59,7 @@
} else if (os_strcmp(buf, "MIB") == 0) {
reply_len = wpa_sm_get_mib(wpa_s->wpa, reply, reply_size);
if (reply_len >= 0) {
@@ -9816,6 +9817,7 @@ char * wpa_supplicant_ctrl_iface_process
@@ -9832,6 +9833,7 @@ char * wpa_supplicant_ctrl_iface_process
reply + reply_len,
reply_size - reply_len);
}
@ -67,7 +67,7 @@
} else if (os_strncmp(buf, "STATUS", 6) == 0) {
reply_len = wpa_supplicant_ctrl_iface_status(
wpa_s, buf + 6, reply, reply_size);
@@ -10297,6 +10299,7 @@ char * wpa_supplicant_ctrl_iface_process
@@ -10313,6 +10315,7 @@ char * wpa_supplicant_ctrl_iface_process
reply_len = wpa_supplicant_ctrl_iface_bss(
wpa_s, buf + 4, reply, reply_size);
#ifdef CONFIG_AP
@ -75,7 +75,7 @@
} 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) {
@@ -10305,12 +10308,15 @@ char * wpa_supplicant_ctrl_iface_process
@@ -10321,12 +10324,15 @@ char * wpa_supplicant_ctrl_iface_process
} else if (os_strncmp(buf, "STA-NEXT ", 9) == 0) {
reply_len = ap_ctrl_iface_sta_next(wpa_s, buf + 9, reply,
reply_size);
@ -101,7 +101,7 @@
static size_t hostapd_write_ht_mcs_bitmask(char *buf, size_t buflen,
size_t curr_len, const u8 *mcs_set)
@@ -408,6 +409,7 @@ int hostapd_ctrl_iface_sta_next(struct h
@@ -415,6 +416,7 @@ int hostapd_ctrl_iface_sta_next(struct h
return hostapd_ctrl_iface_sta_mib(hapd, sta->next, buf, buflen);
}
@ -109,7 +109,7 @@
#ifdef CONFIG_P2P_MANAGER
static int p2p_manager_disconnect(struct hostapd_data *hapd, u16 stype,
@@ -746,12 +748,12 @@ int hostapd_ctrl_iface_status(struct hos
@@ -753,12 +755,12 @@ int hostapd_ctrl_iface_status(struct hos
return len;
len += ret;
}
@ -126,7 +126,7 @@
if (os_snprintf_error(buflen - len, ret))
--- a/src/ap/ieee802_1x.c
+++ b/src/ap/ieee802_1x.c
@@ -2504,6 +2504,7 @@ static const char * bool_txt(Boolean val
@@ -2555,6 +2555,7 @@ static const char * bool_txt(Boolean val
return val ? "TRUE" : "FALSE";
}
@ -134,7 +134,7 @@
int ieee802_1x_get_mib(struct hostapd_data *hapd, char *buf, size_t buflen)
{
@@ -2679,6 +2680,7 @@ int ieee802_1x_get_mib_sta(struct hostap
@@ -2730,6 +2731,7 @@ int ieee802_1x_get_mib_sta(struct hostap
return len;
}
@ -182,7 +182,7 @@
--- a/wpa_supplicant/ap.c
+++ b/wpa_supplicant/ap.c
@@ -1170,7 +1170,7 @@ int wpas_ap_wps_nfc_report_handover(stru
@@ -1179,7 +1179,7 @@ int wpas_ap_wps_nfc_report_handover(stru
#endif /* CONFIG_WPS */

View file

@ -174,7 +174,7 @@ Signed-hostap: Antonio Quartulli <ordex@autistici.org>
* macsec_policy - Determines the policy for MACsec secure session
--- a/wpa_supplicant/wpa_supplicant.c
+++ b/wpa_supplicant/wpa_supplicant.c
@@ -3000,6 +3000,12 @@ static void wpas_start_assoc_cb(struct w
@@ -3034,6 +3034,12 @@ static void wpas_start_assoc_cb(struct w
params.beacon_int = ssid->beacon_int;
else
params.beacon_int = wpa_s->conf->beacon_int;

View file

@ -29,7 +29,7 @@ Tested-by: Simon Wunderlich <simon.wunderlich@openmesh.com>
/**
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
@@ -9217,6 +9217,18 @@ static int nl80211_put_mesh_id(struct nl
@@ -9250,6 +9250,18 @@ static int nl80211_put_mesh_id(struct nl
}
@ -48,7 +48,7 @@ Tested-by: Simon Wunderlich <simon.wunderlich@openmesh.com>
static int nl80211_put_mesh_config(struct nl_msg *msg,
struct wpa_driver_mesh_bss_params *params)
{
@@ -9278,6 +9290,7 @@ static int nl80211_join_mesh(struct i802
@@ -9311,6 +9323,7 @@ static int nl80211_join_mesh(struct i802
nl80211_put_basic_rates(msg, params->basic_rates) ||
nl80211_put_mesh_id(msg, params->meshid, params->meshid_len) ||
nl80211_put_beacon_int(msg, params->beacon_int) ||
@ -58,7 +58,7 @@ Tested-by: Simon Wunderlich <simon.wunderlich@openmesh.com>
--- a/wpa_supplicant/mesh.c
+++ b/wpa_supplicant/mesh.c
@@ -456,6 +456,7 @@ int wpa_supplicant_join_mesh(struct wpa_
@@ -455,6 +455,7 @@ int wpa_supplicant_join_mesh(struct wpa_
params->meshid = ssid->ssid;
params->meshid_len = ssid->ssid_len;

View file

@ -49,7 +49,7 @@
struct hostapd_iface * hostapd_alloc_iface(void);
--- a/src/ap/hostapd.c
+++ b/src/ap/hostapd.c
@@ -312,6 +312,7 @@ static void hostapd_free_hapd_data(struc
@@ -315,6 +315,7 @@ static void hostapd_free_hapd_data(struc
hapd->started = 0;
wpa_printf(MSG_DEBUG, "%s(%s)", __func__, hapd->conf->iface);
@ -57,7 +57,7 @@
iapp_deinit(hapd->iapp);
hapd->iapp = NULL;
accounting_deinit(hapd);
@@ -1189,6 +1190,8 @@ static int hostapd_setup_bss(struct host
@@ -1237,6 +1238,8 @@ static int hostapd_setup_bss(struct host
if (hapd->driver && hapd->driver->set_operstate)
hapd->driver->set_operstate(hapd->drv_priv, 1);
@ -66,7 +66,7 @@
return 0;
}
@@ -1603,7 +1606,7 @@ static enum nr_chan_width hostapd_get_nr
@@ -1651,7 +1654,7 @@ static enum nr_chan_width hostapd_get_nr
#endif /* NEED_AP_MLME */
@ -75,7 +75,7 @@
{
#ifdef NEED_AP_MLME
u16 capab = hostapd_own_capab_info(hapd);
@@ -1810,6 +1813,7 @@ static int hostapd_setup_interface_compl
@@ -1872,6 +1875,7 @@ static int hostapd_setup_interface_compl
if (err)
goto fail;
@ -83,7 +83,7 @@
wpa_printf(MSG_DEBUG, "Completing interface initialization");
if (iface->conf->channel) {
#ifdef NEED_AP_MLME
@@ -1990,6 +1994,7 @@ dfs_offload:
@@ -2052,6 +2056,7 @@ dfs_offload:
fail:
wpa_printf(MSG_ERROR, "Interface initialization failed");
@ -91,7 +91,7 @@
hostapd_set_state(iface, HAPD_IFACE_DISABLED);
wpa_msg(hapd->msg_ctx, MSG_INFO, AP_EVENT_DISABLED);
#ifdef CONFIG_FST
@@ -2444,6 +2449,7 @@ void hostapd_interface_deinit_free(struc
@@ -2517,6 +2522,7 @@ void hostapd_interface_deinit_free(struc
(unsigned int) iface->conf->num_bss);
driver = iface->bss[0]->driver;
drv_priv = iface->bss[0]->drv_priv;
@ -143,7 +143,7 @@
if (res == HOSTAPD_ACL_PENDING)
return;
@@ -3129,12 +3142,12 @@ void fils_hlp_timeout(void *eloop_ctx, v
@@ -3137,12 +3150,12 @@ void fils_hlp_timeout(void *eloop_ctx, v
static void handle_assoc(struct hostapd_data *hapd,
const struct ieee80211_mgmt *mgmt, size_t len,
@ -158,7 +158,7 @@
struct sta_info *sta;
u8 *tmp = NULL;
struct hostapd_sta_wpa_psk_short *psk = NULL;
@@ -3143,6 +3156,11 @@ static void handle_assoc(struct hostapd_
@@ -3151,6 +3164,11 @@ static void handle_assoc(struct hostapd_
#ifdef CONFIG_FILS
int delay_assoc = 0;
#endif /* CONFIG_FILS */
@ -170,7 +170,7 @@
if (len < IEEE80211_HDRLEN + (reassoc ? sizeof(mgmt->u.reassoc_req) :
sizeof(mgmt->u.assoc_req))) {
@@ -3314,6 +3332,14 @@ static void handle_assoc(struct hostapd_
@@ -3322,6 +3340,14 @@ static void handle_assoc(struct hostapd_
}
#endif /* CONFIG_MBO */
@ -185,7 +185,7 @@
/*
* sta->capability is used in check_assoc_ies() for RRM enabled
* capability element.
@@ -3527,6 +3553,7 @@ static void handle_disassoc(struct hosta
@@ -3535,6 +3561,7 @@ static void handle_disassoc(struct hosta
wpa_printf(MSG_DEBUG, "disassocation: STA=" MACSTR " reason_code=%d",
MAC2STR(mgmt->sa),
le_to_host16(mgmt->u.disassoc.reason_code));
@ -193,7 +193,7 @@
sta = ap_get_sta(hapd, mgmt->sa);
if (sta == NULL) {
@@ -3592,6 +3619,8 @@ static void handle_deauth(struct hostapd
@@ -3600,6 +3627,8 @@ static void handle_deauth(struct hostapd
" reason_code=%d",
MAC2STR(mgmt->sa), le_to_host16(mgmt->u.deauth.reason_code));
@ -202,7 +202,7 @@
sta = ap_get_sta(hapd, mgmt->sa);
if (sta == NULL) {
wpa_msg(hapd->msg_ctx, MSG_DEBUG, "Station " MACSTR " trying "
@@ -3911,7 +3940,7 @@ int ieee802_11_mgmt(struct hostapd_data
@@ -3919,7 +3948,7 @@ int ieee802_11_mgmt(struct hostapd_data
if (stype == WLAN_FC_STYPE_PROBE_REQ) {
@ -211,7 +211,7 @@
return 1;
}
@@ -3931,17 +3960,17 @@ int ieee802_11_mgmt(struct hostapd_data
@@ -3939,17 +3968,17 @@ int ieee802_11_mgmt(struct hostapd_data
switch (stype) {
case WLAN_FC_STYPE_AUTH:
wpa_printf(MSG_DEBUG, "mgmt::auth");
@ -315,7 +315,7 @@
wpabuf_free(sta->p2p_ie);
--- a/src/ap/sta_info.c
+++ b/src/ap/sta_info.c
@@ -412,6 +412,7 @@ void ap_handle_timer(void *eloop_ctx, vo
@@ -415,6 +415,7 @@ void ap_handle_timer(void *eloop_ctx, vo
HOSTAPD_LEVEL_INFO, "deauthenticated due to "
"local deauth request");
ap_free_sta(hapd, sta);
@ -323,7 +323,7 @@
return;
}
@@ -559,6 +560,7 @@ skip_poll:
@@ -562,6 +563,7 @@ skip_poll:
hapd, sta,
WLAN_REASON_PREV_AUTH_NOT_VALID);
ap_free_sta(hapd, sta);
@ -331,7 +331,7 @@
break;
}
}
@@ -1220,6 +1222,7 @@ void ap_sta_set_authorized(struct hostap
@@ -1223,6 +1225,7 @@ void ap_sta_set_authorized(struct hostap
buf, ip_addr);
} else {
wpa_msg(hapd->msg_ctx, MSG_INFO, AP_STA_DISCONNECTED "%s", buf);