summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Sperling <stsp@cvs.openbsd.org>2016-01-25 15:14:23 +0000
committerStefan Sperling <stsp@cvs.openbsd.org>2016-01-25 15:14:23 +0000
commit5bdfb57325d30a92040d4a666a895ff8763066ba (patch)
tree33b24aabd6447afe3f7ba44fc673b0b631e66d49
parent4c8e10bc8390da477e64975371bd8fc17db254cf (diff)
Honour ERP protection on 2 GHz channels in 11n mode, as done for 11g.
ok millert@
-rw-r--r--sys/net80211/ieee80211_input.c6
-rw-r--r--sys/net80211/ieee80211_node.c10
2 files changed, 11 insertions, 5 deletions
diff --git a/sys/net80211/ieee80211_input.c b/sys/net80211/ieee80211_input.c
index 77c48d41bce..75736dc951e 100644
--- a/sys/net80211/ieee80211_input.c
+++ b/sys/net80211/ieee80211_input.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ieee80211_input.c,v 1.153 2016/01/25 15:10:37 stsp Exp $ */
+/* $OpenBSD: ieee80211_input.c,v 1.154 2016/01/25 15:14:22 stsp Exp $ */
/*-
* Copyright (c) 2001 Atsushi Onoe
@@ -2299,7 +2299,9 @@ ieee80211_recv_assoc_resp(struct ieee80211com *ic, struct mbuf *m,
/*
* Honor ERP protection.
*/
- if (ic->ic_curmode == IEEE80211_MODE_11G &&
+ if ((ic->ic_curmode == IEEE80211_MODE_11G ||
+ (ic->ic_curmode == IEEE80211_MODE_11N &&
+ IEEE80211_IS_CHAN_2GHZ(ni->ni_chan))) &&
(ni->ni_erp & IEEE80211_ERP_USE_PROTECTION))
ic->ic_flags |= IEEE80211_F_USEPROT;
else
diff --git a/sys/net80211/ieee80211_node.c b/sys/net80211/ieee80211_node.c
index 7e30ab8a1f7..89b687400dd 100644
--- a/sys/net80211/ieee80211_node.c
+++ b/sys/net80211/ieee80211_node.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ieee80211_node.c,v 1.98 2016/01/25 15:10:37 stsp Exp $ */
+/* $OpenBSD: ieee80211_node.c,v 1.99 2016/01/25 15:14:22 stsp Exp $ */
/* $NetBSD: ieee80211_node.c,v 1.14 2004/05/09 09:18:47 dyoung Exp $ */
/*-
@@ -1517,7 +1517,9 @@ ieee80211_node_join(struct ieee80211com *ic, struct ieee80211_node *ni,
ni->ni_associd = aid | 0xc000;
IEEE80211_AID_SET(ni->ni_associd, ic->ic_aid_bitmap);
newassoc = 1;
- if (ic->ic_curmode == IEEE80211_MODE_11G)
+ if (ic->ic_curmode == IEEE80211_MODE_11G ||
+ (ic->ic_curmode == IEEE80211_MODE_11N &&
+ IEEE80211_IS_CHAN_2GHZ(ic->ic_bss->ni_chan)))
ieee80211_node_join_11g(ic, ni);
} else
newassoc = 0;
@@ -1684,7 +1686,9 @@ ieee80211_node_leave(struct ieee80211com *ic, struct ieee80211_node *ni)
if (ic->ic_flags & IEEE80211_F_RSNON)
ieee80211_node_leave_rsn(ic, ni);
- if (ic->ic_curmode == IEEE80211_MODE_11G)
+ if (ic->ic_curmode == IEEE80211_MODE_11G ||
+ (ic->ic_curmode == IEEE80211_MODE_11N &&
+ IEEE80211_IS_CHAN_2GHZ(ic->ic_bss->ni_chan)))
ieee80211_node_leave_11g(ic, ni);
if (ni->ni_flags & IEEE80211_NODE_HT)