diff options
author | Damien Bergamini <damien@cvs.openbsd.org> | 2008-08-02 08:20:17 +0000 |
---|---|---|
committer | Damien Bergamini <damien@cvs.openbsd.org> | 2008-08-02 08:20:17 +0000 |
commit | 030ed887c3898c59480eff565ffe1f6861df249d (patch) | |
tree | e325f8ae08d4ab6be73fea6a66d0e98abeb02c97 /sys/net80211/ieee80211_output.c | |
parent | 163c5153ed3152ac34387e524a941ec941c199b5 (diff) |
Drop frames that are received unencrypted when WEP is on or when
WPA is on and RX protection for TA is on.
Keep track of the TX/RX protection for each node when WPA is on.
tested by djm@ (ral+wpa), ckuethe@ (ath-noenc) and krw@ (wpi<->ral+wpa).
hints from bluhm@
has been in snaps for a few days.
pointed out by bluhm@ something like 1 year ago but we did not have
the right infrastructure to fix it properly at that time.
ok deraadt@
Diffstat (limited to 'sys/net80211/ieee80211_output.c')
-rw-r--r-- | sys/net80211/ieee80211_output.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/net80211/ieee80211_output.c b/sys/net80211/ieee80211_output.c index 7ed7b2b9d00..982d7664143 100644 --- a/sys/net80211/ieee80211_output.c +++ b/sys/net80211/ieee80211_output.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ieee80211_output.c,v 1.63 2008/07/27 14:21:15 damien Exp $ */ +/* $OpenBSD: ieee80211_output.c,v 1.64 2008/08/02 08:20:16 damien Exp $ */ /* $NetBSD: ieee80211_output.c,v 1.13 2004/05/31 11:02:55 dyoung Exp $ */ /*- @@ -501,7 +501,8 @@ ieee80211_encap(struct ifnet *ifp, struct mbuf *m, struct ieee80211_node **pni) goto bad; } - if ((ic->ic_flags & IEEE80211_F_RSNON) && !ni->ni_port_valid && + if ((ic->ic_flags & IEEE80211_F_RSNON) && + !ni->ni_port_valid && eh.ether_type != htons(ETHERTYPE_PAE)) { DPRINTF(("port not valid: %s\n", ether_sprintf(eh.ether_dhost))); @@ -581,7 +582,8 @@ ieee80211_encap(struct ifnet *ifp, struct mbuf *m, struct ieee80211_node **pni) } if ((ic->ic_flags & IEEE80211_F_WEPON) || - ((ic->ic_flags & IEEE80211_F_RSNON) && ni->ni_port_valid)) + ((ic->ic_flags & IEEE80211_F_RSNON) && + (ni->ni_flags & IEEE80211_NODE_TXPROT))) wh->i_fc[1] |= IEEE80211_FC1_PROTECTED; *pni = ni; |