summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordamien <damien@openbsd.org>2006-08-29 18:10:34 +0000
committerdamien <damien@openbsd.org>2006-08-29 18:10:34 +0000
commit7ff1e41d358ab4eab38a61c9a6939016c6742345 (patch)
tree16a37316d9f8312a18f0f31002f0e01701c4bb67
parentadd support for ufqdn ids in ike rules (diff)
downloadwireguard-openbsd-7ff1e41d358ab4eab38a61c9a6939016c6742345.tar.xz
wireguard-openbsd-7ff1e41d358ab4eab38a61c9a6939016c6742345.zip
Fix handling of beacon frames by stations while they're associated.
Changes in the ERP information element and in the capinfo field were not detected properly, so the drivers were not able to adjust their settings (like short slot time, short preamble, protection mode etc...) dynamically. Should fix BSS mode with both 802.11b and 802.11g stations. ok reyk@
-rw-r--r--sys/net80211/ieee80211_input.c18
1 files changed, 5 insertions, 13 deletions
diff --git a/sys/net80211/ieee80211_input.c b/sys/net80211/ieee80211_input.c
index 9f1a4295b97..f7c904ffbc1 100644
--- a/sys/net80211/ieee80211_input.c
+++ b/sys/net80211/ieee80211_input.c
@@ -1,6 +1,5 @@
/* $NetBSD: ieee80211_input.c,v 1.24 2004/05/31 11:12:24 dyoung Exp $ */
-/* $OpenBSD: ieee80211_input.c,v 1.20 2006/08/29 18:02:41 damien Exp $ */
-
+/* $OpenBSD: ieee80211_input.c,v 1.21 2006/08/29 18:10:34 damien Exp $ */
/*-
* Copyright (c) 2001 Atsushi Onoe
* Copyright (c) 2002, 2003 Sam Leffler, Errno Consulting
@@ -1106,12 +1105,8 @@ ieee80211_recv_mgmt(struct ieee80211com *ic, struct mbuf *m0,
* now.
*/
if (ic->ic_opmode == IEEE80211_M_STA &&
- ni->ni_associd != 0 &&
- (!(ic->ic_flags & IEEE80211_F_ASCAN) ||
- IEEE80211_ADDR_EQ(wh->i_addr2, ni->ni_bssid))) {
- /* record tsf of last beacon */
- ni->ni_rstamp = rstamp;
- memcpy(ni->ni_tstamp, tstamp, sizeof(ni->ni_tstamp));
+ ic->ic_state == IEEE80211_S_ASSOC &&
+ ni->ni_state == IEEE80211_STA_BSS) {
/*
* Check if protection mode has changed since last
* beacon.
@@ -1120,13 +1115,13 @@ ieee80211_recv_mgmt(struct ieee80211com *ic, struct mbuf *m0,
IEEE80211_DPRINTF((
"[%s] erp change: was 0x%x, now 0x%x\n",
ether_sprintf(wh->i_addr2), ni->ni_erp,
- erp));
+ erp));
if (ic->ic_curmode == IEEE80211_MODE_11G &&
(erp & IEEE80211_ERP_USE_PROTECTION))
ic->ic_flags |= IEEE80211_F_USEPROT;
else
ic->ic_flags &= ~IEEE80211_F_USEPROT;
- ni->ni_erp = erp;
+ ic->ic_bss->ni_erp = erp;
}
/*
@@ -1140,10 +1135,7 @@ ieee80211_recv_mgmt(struct ieee80211com *ic, struct mbuf *m0,
ic->ic_curmode == IEEE80211_MODE_11A ||
(letoh16(*(u_int16_t *)capinfo) &
IEEE80211_CAPINFO_SHORT_SLOTTIME));
- ni->ni_capinfo =
- letoh16(*(u_int16_t *)capinfo);
}
- break;
}
if (ssid[1] != 0 && ni->ni_esslen == 0) {