summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpatrick <patrick@openbsd.org>2018-11-20 10:00:15 +0000
committerpatrick <patrick@openbsd.org>2018-11-20 10:00:15 +0000
commit25d2707a1a6dc41c82a116e694ffa76c1e169891 (patch)
tree7c63d01ef656266986a9b4cb6c85fff3a55d380e
parentFix spelling of kettenis' email address (diff)
downloadwireguard-openbsd-25d2707a1a6dc41c82a116e694ffa76c1e169891.tar.xz
wireguard-openbsd-25d2707a1a6dc41c82a116e694ffa76c1e169891.zip
The first packet received from each AP in each QoS class would be
dropped as the sequence number matches the initial value of the cached last sequence number (zero). On some APs (notably Android WIFI hotspots) this hits the first packet of the WPA2 4-way handshake. This causes connection delays and in some cases connection to the AP fails completely. Initialize the cached last sequence numbers for received packets to an invalid value instead. From Christian Ehrhardt ok gerhard@ stsp@
-rw-r--r--sys/net80211/ieee80211_node.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/sys/net80211/ieee80211_node.c b/sys/net80211/ieee80211_node.c
index 30d94c20d0a..176f20d15c8 100644
--- a/sys/net80211/ieee80211_node.c
+++ b/sys/net80211/ieee80211_node.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ieee80211_node.c,v 1.155 2018/10/27 10:02:47 phessler Exp $ */
+/* $OpenBSD: ieee80211_node.c,v 1.156 2018/11/20 10:00:15 patrick Exp $ */
/* $NetBSD: ieee80211_node.c,v 1.14 2004/05/09 09:18:47 dyoung Exp $ */
/*-
@@ -1548,13 +1548,17 @@ void
ieee80211_setup_node(struct ieee80211com *ic,
struct ieee80211_node *ni, const u_int8_t *macaddr)
{
- int s;
+ int i, s;
DPRINTF(("%s\n", ether_sprintf((u_int8_t *)macaddr)));
IEEE80211_ADDR_COPY(ni->ni_macaddr, macaddr);
ieee80211_node_newstate(ni, IEEE80211_STA_CACHE);
ni->ni_ic = ic; /* back-pointer */
+ /* Initialize cached last sequence numbers with invalid values. */
+ ni->ni_rxseq = 0xffffU;
+ for (i=0; i < IEEE80211_NUM_TID; ++i)
+ ni->ni_qos_rxseqs[i] = 0xffffU;
#ifndef IEEE80211_STA_ONLY
mq_init(&ni->ni_savedq, IEEE80211_PS_MAX_QUEUE, IPL_NET);
timeout_set(&ni->ni_eapol_to, ieee80211_eapol_timeout, ni);