Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-6]: src/sys/net80211 Pull up following revision(s) (requested by ...
details: https://anonhg.NetBSD.org/src/rev/f9a9ecdfd775
branches: netbsd-6
changeset: 777104:f9a9ecdfd775
user: bouyer <bouyer%NetBSD.org@localhost>
date: Wed Aug 31 15:15:57 2016 +0000
description:
Pull up following revision(s) (requested by mlelstv in ticket #1382):
sys/net80211/ieee80211_input.c: revision 1.83
sys/net80211/ieee80211_input.c: revision 1.84
Don't check sequence number on multicast packets in station mode.
Handle overflow of 12bit sequence number.
In station mode filter packets that or not for us in case the
interface is in promiscous mode or doesn't filter packets itself.
diffstat:
sys/net80211/ieee80211_input.c | 38 +++++++++++++++++++++++++++++---------
1 files changed, 29 insertions(+), 9 deletions(-)
diffs (77 lines):
diff -r a5f09f838a42 -r f9a9ecdfd775 sys/net80211/ieee80211_input.c
--- a/sys/net80211/ieee80211_input.c Sun Aug 28 10:50:37 2016 +0000
+++ b/sys/net80211/ieee80211_input.c Wed Aug 31 15:15:57 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ieee80211_input.c,v 1.72 2011/12/31 20:41:58 christos Exp $ */
+/* $NetBSD: ieee80211_input.c,v 1.72.2.1 2016/08/31 15:15:57 bouyer Exp $ */
/*-
* Copyright (c) 2001 Atsushi Onoe
* Copyright (c) 2002-2005 Sam Leffler, Errno Consulting
@@ -36,7 +36,7 @@
__FBSDID("$FreeBSD: src/sys/net80211/ieee80211_input.c,v 1.81 2005/08/10 16:22:29 sam Exp $");
#endif
#ifdef __NetBSD__
-__KERNEL_RCSID(0, "$NetBSD: ieee80211_input.c,v 1.72 2011/12/31 20:41:58 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ieee80211_input.c,v 1.72.2.1 2016/08/31 15:15:57 bouyer Exp $");
#endif
#include "opt_inet.h"
@@ -224,6 +224,18 @@
ic->ic_stats.is_rx_wrongbss++;
goto out;
}
+
+ /* Filter out packets not directed to us in case the
+ * device is in promiscous mode
+ */
+ if ((! IEEE80211_IS_MULTICAST(wh->i_addr1))
+ && (! IEEE80211_ADDR_EQ(wh->i_addr1, ic->ic_myaddr))) {
+ IEEE80211_DISCARD_MAC(ic, IEEE80211_MSG_INPUT,
+ bssid, NULL, "not to cur sta: lladdr=%6D, addr1=%6D",
+ ic->ic_myaddr, ":", wh->i_addr1, ":");
+ ic->ic_stats.is_rx_wrongbss++;
+ goto out;
+ }
break;
case IEEE80211_M_IBSS:
case IEEE80211_M_AHDEMO:
@@ -280,8 +292,11 @@
}
ni->ni_rssi = rssi;
ni->ni_rstamp = rstamp;
- if (HAS_SEQ(type)) {
- u_int8_t tid;
+ if (HAS_SEQ(type) && (ic->ic_opmode != IEEE80211_M_STA ||
+ !IEEE80211_IS_MULTICAST(wh->i_addr1))) {
+ u_int8_t tid, retry;
+ u_int16_t rxno, orxno;
+
if (IEEE80211_QOS_HAS_SEQ(wh)) {
tid = ((struct ieee80211_qosframe *)wh)->
i_qos[0] & IEEE80211_QOS_TID;
@@ -291,15 +306,20 @@
} else
tid = 0;
rxseq = le16toh(*(u_int16_t *)wh->i_seq);
- if ((wh->i_fc[1] & IEEE80211_FC1_RETRY) &&
- SEQ_LEQ(rxseq, ni->ni_rxseqs[tid])) {
+ retry = wh->i_fc[1] & IEEE80211_FC1_RETRY;
+ rxno = rxseq >> IEEE80211_SEQ_SEQ_SHIFT;
+ orxno = ni->ni_rxseqs[tid] >> IEEE80211_SEQ_SEQ_SHIFT;
+ if (retry && (
+ (orxno == 4095 && rxno == orxno) ||
+ (orxno != 4095 &&
+ SEQ_LEQ(rxseq, ni->ni_rxseqs[tid]))
+ )) {
/* duplicate, discard */
IEEE80211_DISCARD_MAC(ic, IEEE80211_MSG_INPUT,
bssid, "duplicate",
"seqno <%u,%u> fragno <%u,%u> tid %u",
- rxseq >> IEEE80211_SEQ_SEQ_SHIFT,
- ni->ni_rxseqs[tid] >>
- IEEE80211_SEQ_SEQ_SHIFT,
+ rxno,
+ orxno,
rxseq & IEEE80211_SEQ_FRAG_MASK,
ni->ni_rxseqs[tid] &
IEEE80211_SEQ_FRAG_MASK,
Home |
Main Index |
Thread Index |
Old Index