- Deleted upstreamed patches & parts - Refreshed all Compile tested: full-option package + tools (hostapd + wpa_supplicant) Run-tested: hostapd wpa2 hotspot & wpa_supplicant IBSS link Targets: cns3xxx Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>master
parent
bd27331eea
commit
2f78034c3e
@ -1,83 +0,0 @@ |
||||
From: Jouni Malinen <jouni@qca.qualcomm.com>
|
||||
Date: Tue, 20 Dec 2016 01:30:09 +0200
|
||||
Subject: [PATCH] Fix race condition between AssocResp callback and 4addr event
|
||||
|
||||
It is apparently possible for the NL80211_CMD_UNEXPECTED_4ADDR_FRAME
|
||||
event to be delivered to hostapd before the NL80211_CMD_FRAME_TX_STATUS
|
||||
event for (Re)Association Response frame. This resulted in the 4-address
|
||||
WDS mode not getting enabled for a STA. This could occur in particular
|
||||
when operating under heavy load and the STA is reconnecting to the same
|
||||
AP in a sequence where Deauthentication frame is followed immediately by
|
||||
Authentication frame and the driver event processing gets delayed due to
|
||||
removal of the previous netdev taking time in the middle of this
|
||||
sequence.
|
||||
|
||||
Fix this by recording a pending item for 4-address WDS enabling if the
|
||||
NL80211_CMD_UNEXPECTED_4ADDR_FRAME event would have been dropped due to
|
||||
incompleted association and then process this pending item if the TX
|
||||
status for the (Re)Association Response frame is received and it shows
|
||||
that the frame was acknowledged.
|
||||
|
||||
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
|
||||
---
|
||||
|
||||
--- a/src/ap/ieee802_11.c
|
||||
+++ b/src/ap/ieee802_11.c
|
||||
@@ -2634,6 +2634,8 @@ static void handle_assoc(struct hostapd_
|
||||
taxonomy_sta_info_assoc_req(hapd, sta, pos, left);
|
||||
#endif /* CONFIG_TAXONOMY */
|
||||
|
||||
+ sta->pending_wds_enable = 0;
|
||||
+
|
||||
fail:
|
||||
/*
|
||||
* In case of a successful response, add the station to the driver.
|
||||
@@ -3248,6 +3250,14 @@ static void handle_assoc_cb(struct hosta
|
||||
|
||||
hostapd_set_sta_flags(hapd, sta);
|
||||
|
||||
+ if (!(sta->flags & WLAN_STA_WDS) && sta->pending_wds_enable) {
|
||||
+ wpa_printf(MSG_DEBUG, "Enable 4-address WDS mode for STA "
|
||||
+ MACSTR " based on pending request",
|
||||
+ MAC2STR(sta->addr));
|
||||
+ sta->pending_wds_enable = 0;
|
||||
+ sta->flags |= WLAN_STA_WDS;
|
||||
+ }
|
||||
+
|
||||
if (sta->flags & WLAN_STA_WDS) {
|
||||
int ret;
|
||||
char ifname_wds[IFNAMSIZ + 1];
|
||||
@@ -3512,10 +3522,22 @@ void ieee802_11_rx_from_unknown(struct h
|
||||
struct sta_info *sta;
|
||||
|
||||
sta = ap_get_sta(hapd, src);
|
||||
- if (sta && (sta->flags & WLAN_STA_ASSOC)) {
|
||||
+ if (sta &&
|
||||
+ ((sta->flags & WLAN_STA_ASSOC) ||
|
||||
+ ((sta->flags & WLAN_STA_ASSOC_REQ_OK) && wds))) {
|
||||
if (!hapd->conf->wds_sta)
|
||||
return;
|
||||
|
||||
+ if ((sta->flags & (WLAN_STA_ASSOC | WLAN_STA_ASSOC_REQ_OK)) ==
|
||||
+ WLAN_STA_ASSOC_REQ_OK) {
|
||||
+ wpa_printf(MSG_DEBUG,
|
||||
+ "Postpone 4-address WDS mode enabling for STA "
|
||||
+ MACSTR " since TX status for AssocResp is not yet known",
|
||||
+ MAC2STR(sta->addr));
|
||||
+ sta->pending_wds_enable = 1;
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
if (wds && !(sta->flags & WLAN_STA_WDS)) {
|
||||
int ret;
|
||||
char ifname_wds[IFNAMSIZ + 1];
|
||||
--- a/src/ap/sta_info.h
|
||||
+++ b/src/ap/sta_info.h
|
||||
@@ -115,6 +115,7 @@ struct sta_info {
|
||||
unsigned int radius_das_match:1;
|
||||
unsigned int ecsa_supported:1;
|
||||
unsigned int added_unassoc:1;
|
||||
+ unsigned int pending_wds_enable:1;
|
||||
|
||||
u16 auth_alg;
|
||||
|
@ -1,36 +0,0 @@ |
||||
From: Jouni Malinen <jouni@qca.qualcomm.com>
|
||||
Date: Sat, 14 Jan 2017 01:04:31 +0200
|
||||
Subject: [PATCH] Fix duplicate Reassociation Request frame dropping
|
||||
|
||||
Relational operators (==) have higher precedence than the ternary
|
||||
conditional in C. The last_subtype check for association/reassociation
|
||||
was broken due to incorrect assumption about the precedence. Fix this by
|
||||
adding parenthesis around the ternary conditional.
|
||||
|
||||
The previous implementation worked for Association Request frames by
|
||||
accident since WLAN_FC_STYPE_ASSOC_REQ happens to have value 0 and when
|
||||
the last receive frame was an Association Request frame, the
|
||||
sta->last_subtype == reassoc check was true and non-zero
|
||||
WLAN_FC_STYPE_REASSOC_REQ was interpreted as true. However, this was
|
||||
broken for Reassociation Request frame. reassoc == 1 in that case could
|
||||
have matched received Association Response frame (subtype == 1), but
|
||||
those are not received in AP mode and as such, this did not break other
|
||||
behavior apart from not being able to drop duplicated Reassociation
|
||||
Request frames.
|
||||
|
||||
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
|
||||
---
|
||||
|
||||
--- a/src/ap/ieee802_11.c
|
||||
+++ b/src/ap/ieee802_11.c
|
||||
@@ -2485,8 +2485,8 @@ static void handle_assoc(struct hostapd_
|
||||
if ((fc & WLAN_FC_RETRY) &&
|
||||
sta->last_seq_ctrl != WLAN_INVALID_MGMT_SEQ &&
|
||||
sta->last_seq_ctrl == seq_ctrl &&
|
||||
- sta->last_subtype == reassoc ? WLAN_FC_STYPE_REASSOC_REQ :
|
||||
- WLAN_FC_STYPE_ASSOC_REQ) {
|
||||
+ sta->last_subtype == (reassoc ? WLAN_FC_STYPE_REASSOC_REQ :
|
||||
+ WLAN_FC_STYPE_ASSOC_REQ)) {
|
||||
hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_IEEE80211,
|
||||
HOSTAPD_LEVEL_DEBUG,
|
||||
"Drop repeated association frame seq_ctrl=0x%x",
|
@ -1,40 +0,0 @@ |
||||
From: Jouni Malinen <j@w1.fi>
|
||||
Date: Sat, 14 Jan 2017 13:56:18 +0200
|
||||
Subject: [PATCH] RSN IBSS: Fix TK clearing on Authentication frame RX
|
||||
|
||||
When wpa_supplicant was processing a received Authentication frame (seq
|
||||
1) from a peer STA for which there was already a TK configured to the
|
||||
driver, debug log claimed that the PTK gets cleared, but the actual
|
||||
call to clear the key was actually dropped due to AUTH vs. SUPP set_key
|
||||
selection. Fix this by explicitly clearing the TK in case it was set
|
||||
and an Authentication frame (seq 1) is received.
|
||||
|
||||
This fixes some cases where EAPOL-Key frames were sent encrypted using
|
||||
the old key when a peer STA restarted itself and lost the key and had to
|
||||
re-join the IBSS. Previously, that state required timing out the 4-way
|
||||
handshake and Deauthentication frame exchange to recover.
|
||||
|
||||
Signed-off-by: Jouni Malinen <j@w1.fi>
|
||||
---
|
||||
|
||||
--- a/wpa_supplicant/ibss_rsn.c
|
||||
+++ b/wpa_supplicant/ibss_rsn.c
|
||||
@@ -838,6 +838,18 @@ static void ibss_rsn_handle_auth_1_of_2(
|
||||
MAC2STR(addr));
|
||||
|
||||
if (peer &&
|
||||
+ peer->authentication_status & (IBSS_RSN_SET_PTK_SUPP |
|
||||
+ IBSS_RSN_SET_PTK_AUTH)) {
|
||||
+ /* Clear the TK for this pair to allow recovery from the case
|
||||
+ * where the peer STA has restarted and lost its key while we
|
||||
+ * still have a pairwise key configured. */
|
||||
+ wpa_printf(MSG_DEBUG, "RSN: Clear pairwise key for peer "
|
||||
+ MACSTR, MAC2STR(addr));
|
||||
+ wpa_drv_set_key(ibss_rsn->wpa_s, WPA_ALG_NONE, addr, 0, 0,
|
||||
+ NULL, 0, NULL, 0);
|
||||
+ }
|
||||
+
|
||||
+ if (peer &&
|
||||
peer->authentication_status & IBSS_RSN_AUTH_EAPOL_BY_PEER) {
|
||||
if (peer->own_auth_tx.sec) {
|
||||
struct os_reltime now, diff;
|
@ -1,145 +0,0 @@ |
||||
From cc3dae85bd694506cdea66ae532d452fb8716297 Mon Sep 17 00:00:00 2001
|
||||
From: Wojciech Dubowik <Wojciech.Dubowik@neratec.com>
|
||||
Date: Mon, 23 Jan 2017 13:55:04 +0100
|
||||
Subject: [PATCH] hostapd: Add possibility to send debug messages to syslog
|
||||
|
||||
We can only send module specific messages to syslog and not debug
|
||||
messages printed with wpa_printf. Add an extra command line parameter
|
||||
'-s' to allow it. The feature is enabled with compile flag
|
||||
CONFIG_DEBUG_SYSLOG as for wpa_supplicant and behaves in the same manner
|
||||
as the wpa_supplicant -s command line argument.
|
||||
|
||||
Signed-off-by: Wojciech Dubowik <Wojciech.Dubowik@neratec.com>
|
||||
---
|
||||
hostapd/Android.mk | 4 ++++
|
||||
hostapd/Makefile | 4 ++++
|
||||
hostapd/defconfig | 3 +++
|
||||
hostapd/main.c | 19 ++++++++++++++++++-
|
||||
src/utils/wpa_debug.c | 2 +-
|
||||
src/utils/wpa_debug.h | 3 +++
|
||||
6 files changed, 33 insertions(+), 2 deletions(-)
|
||||
|
||||
--- a/hostapd/Android.mk
|
||||
+++ b/hostapd/Android.mk
|
||||
@@ -952,6 +952,10 @@ ifdef CONFIG_NO_STDOUT_DEBUG
|
||||
L_CFLAGS += -DCONFIG_NO_STDOUT_DEBUG
|
||||
endif
|
||||
|
||||
+ifdef CONFIG_DEBUG_SYSLOG
|
||||
+L_CFLAGS += -DCONFIG_DEBUG_SYSLOG
|
||||
+endif
|
||||
+
|
||||
ifdef CONFIG_DEBUG_LINUX_TRACING
|
||||
L_CFLAGS += -DCONFIG_DEBUG_LINUX_TRACING
|
||||
endif
|
||||
--- a/hostapd/Makefile
|
||||
+++ b/hostapd/Makefile
|
||||
@@ -997,6 +997,10 @@ ifdef CONFIG_NO_STDOUT_DEBUG
|
||||
CFLAGS += -DCONFIG_NO_STDOUT_DEBUG
|
||||
endif
|
||||
|
||||
+ifdef CONFIG_DEBUG_SYSLOG
|
||||
+CFLAGS += -DCONFIG_DEBUG_SYSLOG
|
||||
+endif
|
||||
+
|
||||
ifdef CONFIG_DEBUG_LINUX_TRACING
|
||||
CFLAGS += -DCONFIG_DEBUG_LINUX_TRACING
|
||||
endif
|
||||
--- a/hostapd/defconfig
|
||||
+++ b/hostapd/defconfig
|
||||
@@ -166,6 +166,9 @@ CONFIG_IPV6=y
|
||||
# Disabled by default.
|
||||
#CONFIG_DEBUG_FILE=y
|
||||
|
||||
+# Send debug messages to syslog instead of stdout
|
||||
+#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
|
||||
# making it easy to record everything happening from the driver up into the
|
||||
--- a/hostapd/main.c
|
||||
+++ b/hostapd/main.c
|
||||
@@ -108,6 +108,10 @@ static void hostapd_logger_cb(void *ctx,
|
||||
module_str ? module_str : "",
|
||||
module_str ? ": " : "", txt);
|
||||
|
||||
+#ifdef CONFIG_DEBUG_SYSLOG
|
||||
+ if (wpa_debug_syslog)
|
||||
+ conf_stdout = 0;
|
||||
+#endif /* CONFIG_DEBUG_SYSLOG */
|
||||
if ((conf_stdout & module) && level >= conf_stdout_level) {
|
||||
wpa_debug_print_timestamp();
|
||||
wpa_printf(MSG_INFO, "%s", format);
|
||||
@@ -484,6 +488,9 @@ static void usage(void)
|
||||
" (records all messages regardless of debug verbosity)\n"
|
||||
#endif /* CONFIG_DEBUG_LINUX_TRACING */
|
||||
" -i list of interface names to use\n"
|
||||
+#ifdef CONFIG_DEBUG_SYSLOG
|
||||
+ " -s log output to syslog instead of stdout\n"
|
||||
+#endif /* CONFIG_DEBUG_SYSLOG */
|
||||
" -S start all the interfaces synchronously\n"
|
||||
" -t include timestamps in some debug messages\n"
|
||||
" -v show hostapd version\n");
|
||||
@@ -661,7 +668,7 @@ int main(int argc, char *argv[])
|
||||
dl_list_init(&interfaces.global_ctrl_dst);
|
||||
|
||||
for (;;) {
|
||||
- c = getopt(argc, argv, "b:Bde:f:hi:KP:STtu:vg:G:");
|
||||
+ c = getopt(argc, argv, "b:Bde:f:hi:KP:sSTtu:vg:G:");
|
||||
if (c < 0)
|
||||
break;
|
||||
switch (c) {
|
||||
@@ -718,6 +725,11 @@ int main(int argc, char *argv[])
|
||||
bss_config = tmp_bss;
|
||||
bss_config[num_bss_configs++] = optarg;
|
||||
break;
|
||||
+#ifdef CONFIG_DEBUG_SYSLOG
|
||||
+ case 's':
|
||||
+ wpa_debug_syslog = 1;
|
||||
+ break;
|
||||
+#endif /* CONFIG_DEBUG_SYSLOG */
|
||||
case 'S':
|
||||
start_ifaces_in_sync = 1;
|
||||
break;
|
||||
@@ -746,6 +758,10 @@ int main(int argc, char *argv[])
|
||||
wpa_debug_open_file(log_file);
|
||||
else
|
||||
wpa_debug_setup_stdout();
|
||||
+#ifdef CONFIG_DEBUG_SYSLOG
|
||||
+ if (wpa_debug_syslog)
|
||||
+ wpa_debug_open_syslog();
|
||||
+#endif /* CONFIG_DEBUG_SYSLOG */
|
||||
#ifdef CONFIG_DEBUG_LINUX_TRACING
|
||||
if (enable_trace_dbg) {
|
||||
int tret = wpa_debug_open_linux_tracing();
|
||||
@@ -882,6 +898,7 @@ int main(int argc, char *argv[])
|
||||
hostapd_global_deinit(pid_file, interfaces.eloop_initialized);
|
||||
os_free(pid_file);
|
||||
|
||||
+ wpa_debug_close_syslog();
|
||||
if (log_file)
|
||||
wpa_debug_close_file();
|
||||
wpa_debug_close_linux_tracing();
|
||||
--- a/src/utils/wpa_debug.c
|
||||
+++ b/src/utils/wpa_debug.c
|
||||
@@ -13,7 +13,7 @@
|
||||
#ifdef CONFIG_DEBUG_SYSLOG
|
||||
#include <syslog.h>
|
||||
|
||||
-static int wpa_debug_syslog = 0;
|
||||
+int wpa_debug_syslog = 0;
|
||||
#endif /* CONFIG_DEBUG_SYSLOG */
|
||||
|
||||
#ifdef CONFIG_DEBUG_LINUX_TRACING
|
||||
--- a/src/utils/wpa_debug.h
|
||||
+++ b/src/utils/wpa_debug.h
|
||||
@@ -14,6 +14,9 @@
|
||||
extern int wpa_debug_level;
|
||||
extern int wpa_debug_show_keys;
|
||||
extern int wpa_debug_timestamp;
|
||||
+#ifdef CONFIG_DEBUG_SYSLOG
|
||||
+extern int wpa_debug_syslog;
|
||||
+#endif /* CONFIG_DEBUG_SYSLOG */
|
||||
|
||||
/* Debugging function - conditional printf and hex dump. Driver wrappers can
|
||||
* use these for debugging purposes. */
|
@ -1,72 +1,54 @@ |
||||
--- a/src/drivers/driver_nl80211.c
|
||||
+++ b/src/drivers/driver_nl80211.c
|
||||
@@ -2490,13 +2490,18 @@ wpa_driver_nl80211_finish_drv_init(struc
|
||||
}
|
||||
|
||||
|
||||
-static int wpa_driver_nl80211_del_beacon(struct wpa_driver_nl80211_data *drv)
|
||||
+static int wpa_driver_nl80211_del_beacon(struct i802_bss *bss)
|
||||
{
|
||||
+ struct wpa_driver_nl80211_data *drv = bss->drv;
|
||||
@@ -2536,10 +2536,15 @@ static int wpa_driver_nl80211_del_beacon
|
||||
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);
|
||||
- msg = nl80211_drv_msg(drv, 0, NL80211_CMD_DEL_BEACON);
|
||||
+ bss->ifindex);
|
||||
nl80211_put_wiphy_data_ap(bss);
|
||||
- msg = nl80211_drv_msg(drv, 0, NL80211_CMD_DEL_BEACON);
|
||||
+ msg = nl80211_bss_msg(bss, 0, NL80211_CMD_DEL_BEACON);
|
||||
return send_and_recv_msgs(drv, msg, NULL, NULL);
|
||||
}
|
||||
|
||||
@@ -2548,7 +2553,7 @@ static void wpa_driver_nl80211_deinit(st
|
||||
nl80211_remove_monitor_interface(drv);
|
||||
|
||||
if (is_ap_interface(drv->nlmode))
|
||||
- wpa_driver_nl80211_del_beacon(drv);
|
||||
+ wpa_driver_nl80211_del_beacon(bss);
|
||||
|
||||
if (drv->eapol_sock >= 0) {
|
||||
eloop_unregister_read_sock(drv->eapol_sock);
|
||||
@@ -4703,8 +4708,7 @@ static void nl80211_teardown_ap(struct i
|
||||
nl80211_remove_monitor_interface(drv);
|
||||
else
|
||||
@@ -4753,7 +4758,7 @@ static void nl80211_teardown_ap(struct i
|
||||
nl80211_mgmt_unsubscribe(bss, "AP teardown");
|
||||
-
|
||||
|
||||
nl80211_put_wiphy_data_ap(bss);
|
||||
- bss->beacon_set = 0;
|
||||
+ wpa_driver_nl80211_del_beacon(bss);
|
||||
}
|
||||
|
||||
|
||||
@@ -6728,8 +6732,6 @@ static int wpa_driver_nl80211_if_remove(
|
||||
@@ -6853,8 +6858,6 @@ static int wpa_driver_nl80211_if_remove(
|
||||
} else {
|
||||
wpa_printf(MSG_DEBUG, "nl80211: First BSS - reassign context");
|
||||
nl80211_teardown_ap(bss);
|
||||
- if (!bss->added_if && !drv->first_bss->next)
|
||||
- wpa_driver_nl80211_del_beacon(drv);
|
||||
- wpa_driver_nl80211_del_beacon(bss);
|
||||
nl80211_destroy_bss(bss);
|
||||
if (!bss->added_if)
|
||||
i802_set_iface_flags(bss, 0);
|
||||
@@ -7091,8 +7093,7 @@ static int wpa_driver_nl80211_deinit_ap(
|
||||
struct wpa_driver_nl80211_data *drv = bss->drv;
|
||||
@@ -7225,7 +7228,6 @@ static int wpa_driver_nl80211_deinit_ap(
|
||||
if (!is_ap_interface(drv->nlmode))
|
||||
return -1;
|
||||
- wpa_driver_nl80211_del_beacon(drv);
|
||||
wpa_driver_nl80211_del_beacon(bss);
|
||||
- bss->beacon_set = 0;
|
||||
+ wpa_driver_nl80211_del_beacon(bss);
|
||||
|
||||
/*
|
||||
* If the P2P GO interface was dynamically added, then it is
|
||||
@@ -7111,8 +7112,7 @@ static int wpa_driver_nl80211_stop_ap(vo
|
||||
struct wpa_driver_nl80211_data *drv = bss->drv;
|
||||
@@ -7245,7 +7247,6 @@ static int wpa_driver_nl80211_stop_ap(vo
|
||||
if (!is_ap_interface(drv->nlmode))
|
||||
return -1;
|
||||
- wpa_driver_nl80211_del_beacon(drv);
|
||||
wpa_driver_nl80211_del_beacon(bss);
|
||||
- bss->beacon_set = 0;
|
||||
+ wpa_driver_nl80211_del_beacon(bss);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in new issue