summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArchie Cobbs <archie@FreeBSD.org>2001-02-08 17:56:49 +0000
committerArchie Cobbs <archie@FreeBSD.org>2001-02-08 17:56:49 +0000
commitcb24f323d0f5b9f98299e1091eceb7058c8058a7 (patch)
tree311c5ccb86b0b77f9312eeb4328259a7a498b72b
parent5fe43ff5b54395969f7235b8b92a091b43abfb88 (diff)
Notes
-rw-r--r--sys/net/if_ethersubr.c24
1 files changed, 14 insertions, 10 deletions
diff --git a/sys/net/if_ethersubr.c b/sys/net/if_ethersubr.c
index ed7fa5741a3a..3aceb45acd39 100644
--- a/sys/net/if_ethersubr.c
+++ b/sys/net/if_ethersubr.c
@@ -412,7 +412,9 @@ ether_input(ifp, eh, m)
struct ether_header *eh;
struct mbuf *m;
{
+#ifdef BRIDGE
struct ether_header save_eh;
+#endif
/* Check for a BPF tap */
if (ifp->if_bpf != NULL) {
@@ -472,16 +474,6 @@ ether_input(ifp, eh, m)
}
#endif
- /* Discard packet if upper layers shouldn't see it. This should
- only happen when the interface is in promiscuous mode. */
- if ((ifp->if_flags & IFF_PROMISC) != 0
- && (eh->ether_dhost[0] & 1) == 0
- && bcmp(eh->ether_dhost,
- IFP2AC(ifp)->ac_enaddr, ETHER_ADDR_LEN) != 0) {
- m_freem(m);
- return;
- }
-
#ifdef BRIDGE
recvLocal:
#endif
@@ -504,6 +496,18 @@ ether_demux(ifp, eh, m)
register struct llc *l;
#endif
+ /* Discard packet if upper layers shouldn't see it because it was
+ unicast to a different Ethernet address. If the driver is working
+ properly, then this situation can only happen when the interface
+ is in promiscuous mode. */
+ if ((ifp->if_flags & IFF_PROMISC) != 0
+ && (eh->ether_dhost[0] & 1) == 0
+ && bcmp(eh->ether_dhost,
+ IFP2AC(ifp)->ac_enaddr, ETHER_ADDR_LEN) != 0) {
+ m_freem(m);
+ return;
+ }
+
/* Discard packet if interface is not up */
if ((ifp->if_flags & IFF_UP) == 0) {
m_freem(m);