summaryrefslogtreecommitdiff
path: root/sys/net
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2010-07-02 00:49:44 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2010-07-02 00:49:44 +0000
commit3af3fca013144ea87b0c90a775ed88ceeb27e805 (patch)
tree3fe7b41818cec39856fc771e1fbc1920d84af39b /sys/net
parent86fe46eb035998e88311038fdb4502b80161f683 (diff)
Some functions change the ifp in during ether_input(). This confuses the
IFF_PROMISC check that ensures that only local packets make it into the network stack. Check both the original ifp and the new ifp for IFF_PROMISC. Problem identified by Patrick Coleman. OK mcbride@, henning@
Diffstat (limited to 'sys/net')
-rw-r--r--sys/net/if_ethersubr.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/net/if_ethersubr.c b/sys/net/if_ethersubr.c
index a82b1c0a9c3..787dc8d160f 100644
--- a/sys/net/if_ethersubr.c
+++ b/sys/net/if_ethersubr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_ethersubr.c,v 1.144 2010/06/03 16:15:00 naddy Exp $ */
+/* $OpenBSD: if_ethersubr.c,v 1.145 2010/07/02 00:49:43 claudio Exp $ */
/* $NetBSD: if_ethersubr.c,v 1.19 1996/05/07 02:40:30 thorpej Exp $ */
/*
@@ -677,7 +677,7 @@ ether_input(ifp0, eh, m)
* is for us. Drop otherwise.
*/
if ((m->m_flags & (M_BCAST|M_MCAST)) == 0 &&
- (ifp->if_flags & IFF_PROMISC)) {
+ ((ifp->if_flags & IFF_PROMISC) || (ifp0->if_flags & IFF_PROMISC))) {
if (bcmp(ac->ac_enaddr, (caddr_t)eh->ether_dhost,
ETHER_ADDR_LEN)) {
m_freem(m);