Module Name: src Committed By: mlelstv Date: Sat May 14 13:35:40 UTC 2016
Modified Files: src/sys/net80211: ieee80211_input.c Log Message: In station mode filter packets that or not for us in case the interface is in promiscous mode or doesn't filter packets itself. To generate a diff of this commit: cvs rdiff -u -r1.83 -r1.84 src/sys/net80211/ieee80211_input.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/net80211/ieee80211_input.c diff -u src/sys/net80211/ieee80211_input.c:1.83 src/sys/net80211/ieee80211_input.c:1.84 --- src/sys/net80211/ieee80211_input.c:1.83 Sat May 7 12:36:50 2016 +++ src/sys/net80211/ieee80211_input.c Sat May 14 13:35:40 2016 @@ -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 @@ ieee80211_input(struct ieee80211com *ic, 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: