Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/net80211 In station mode filter packets that or not for ...



details:   https://anonhg.NetBSD.org/src/rev/2c359046fa3d
branches:  trunk
changeset: 345247:2c359046fa3d
user:      mlelstv <mlelstv%NetBSD.org@localhost>
date:      Sat May 14 13:35:40 2016 +0000

description:
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 |  16 ++++++++++++++--
 1 files changed, 14 insertions(+), 2 deletions(-)

diffs (37 lines):

diff -r 7df38736ff42 -r 2c359046fa3d sys/net80211/ieee80211_input.c
--- a/sys/net80211/ieee80211_input.c    Sat May 14 12:48:31 2016 +0000
+++ b/sys/net80211/ieee80211_input.c    Sat May 14 13:35:40 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ieee80211_input.c,v 1.83 2016/05/07 12:36:50 mlelstv Exp $     */
+/*     $NetBSD: ieee80211_input.c,v 1.84 2016/05/14 13:35:40 mlelstv 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.83 2016/05/07 12:36:50 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ieee80211_input.c,v 1.84 2016/05/14 13:35:40 mlelstv Exp $");
 #endif
 
 #ifdef _KERNEL_OPT
@@ -226,6 +226,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:



Home | Main Index | Thread Index | Old Index