diff options
author | 2010-07-02 00:49:43 +0000 | |
---|---|---|
committer | 2010-07-02 00:49:43 +0000 | |
commit | b55508e36caa92ec3aac52f77e8ef9bae7e1a00d (patch) | |
tree | c7697a490c147eececb1d9b0f98e35ca29fcb452 | |
parent | Fix memory leaks in schema parser. (diff) | |
download | wireguard-openbsd-b55508e36caa92ec3aac52f77e8ef9bae7e1a00d.tar.xz wireguard-openbsd-b55508e36caa92ec3aac52f77e8ef9bae7e1a00d.zip |
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@
-rw-r--r-- | sys/net/if_ethersubr.c | 4 |
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); |