summaryrefslogtreecommitdiffstats
path: root/sys/pci
diff options
context:
space:
mode:
authorarchie <archie@FreeBSD.org>2000-05-14 02:18:43 +0000
committerarchie <archie@FreeBSD.org>2000-05-14 02:18:43 +0000
commitfa21035b4e2f11d2c8f90174690853600b670e2d (patch)
tree9afb8dacfff6d7607064d8aa2bbf2da5069e8be6 /sys/pci
parentd066b073153b986a54fd18a31d6bcc5d697933a2 (diff)
downloadFreeBSD-src-fa21035b4e2f11d2c8f90174690853600b670e2d.zip
FreeBSD-src-fa21035b4e2f11d2c8f90174690853600b670e2d.tar.gz
Move code to handle BPF and bridging for incoming Ethernet packets out
of the individual drivers and into the common routine ether_input(). Also, remove the (incomplete) hack for matching ethernet headers in the ip_fw code. The good news: net result of 1016 lines removed, and this should make bridging now work with *all* Ethernet drivers. The bad news: it's nearly impossible to test every driver, especially for bridging, and I was unable to get much testing help on the mailing lists. Reviewed by: freebsd-net
Diffstat (limited to 'sys/pci')
-rw-r--r--sys/pci/if_dc.c40
-rw-r--r--sys/pci/if_de.c29
-rw-r--r--sys/pci/if_fxp.c51
-rw-r--r--sys/pci/if_rl.c17
-rw-r--r--sys/pci/if_sf.c11
-rw-r--r--sys/pci/if_sis.c16
-rw-r--r--sys/pci/if_sk.c10
-rw-r--r--sys/pci/if_ste.c37
-rw-r--r--sys/pci/if_ti.c17
-rw-r--r--sys/pci/if_tl.c20
-rw-r--r--sys/pci/if_tx.c50
-rw-r--r--sys/pci/if_vr.c36
-rw-r--r--sys/pci/if_wb.c37
-rw-r--r--sys/pci/if_wx.c2
-rw-r--r--sys/pci/if_xl.c37
15 files changed, 6 insertions, 404 deletions
diff --git a/sys/pci/if_dc.c b/sys/pci/if_dc.c
index 67f46f8..7344561 100644
--- a/sys/pci/if_dc.c
+++ b/sys/pci/if_dc.c
@@ -122,11 +122,6 @@
#include <net/bpf.h>
-#include "opt_bdg.h"
-#ifdef BRIDGE
-#include <net/bridge.h>
-#endif
-
#include <vm/vm.h> /* for vtophys */
#include <vm/pmap.h> /* for vtophys */
#include <machine/clock.h> /* for DELAY */
@@ -2133,47 +2128,12 @@ static void dc_rxeof(sc)
ifp->if_ipackets++;
eh = mtod(m, struct ether_header *);
- /* Handle BPF listeners. Let the BPF user see the packet */
- if (ifp->if_bpf)
- bpf_mtap(ifp, m);
-
-#ifdef BRIDGE
- if (do_bridge) {
- struct ifnet *bdg_ifp ;
- bdg_ifp = bridge_in(m);
- if (bdg_ifp != BDG_LOCAL && bdg_ifp != BDG_DROP)
- bdg_forward(&m, bdg_ifp);
- if (((bdg_ifp != BDG_LOCAL) && (bdg_ifp != BDG_BCAST) && (bdg_ifp != BDG_MCAST)) || bdg_ifp == BDG_DROP) {
- m_freem(m);
- continue;
- }
- }
-
- eh = mtod(m, struct ether_header *);
-#endif
-
- /* Don't pass it up to the ether_input() layer unless it's
- * a broadcast packet, multicast packet, matches our ethernet
- * address or the interface is in promiscuous mode.
- */
- if (ifp->if_bpf) {
- if (ifp->if_flags & IFF_PROMISC &&
- (bcmp(eh->ether_dhost, sc->arpcom.ac_enaddr,
- ETHER_ADDR_LEN) &&
- (eh->ether_dhost[0] & 1) == 0)) {
- m_freem(m);
- continue;
- }
- }
-
/* Remove header from mbuf and pass it on. */
m_adj(m, sizeof(struct ether_header));
ether_input(ifp, eh, m);
}
sc->dc_cdata.dc_rx_prod = i;
-
- return;
}
/*
diff --git a/sys/pci/if_de.c b/sys/pci/if_de.c
index 8054bd5..e949c94 100644
--- a/sys/pci/if_de.c
+++ b/sys/pci/if_de.c
@@ -89,11 +89,6 @@
#include <pci/pcireg.h>
#include <pci/dc21040reg.h>
-#include "opt_bdg.h"
-#ifdef BRIDGE
-#include <net/bridge.h>
-#endif
-
/*
* Intel CPUs should use I/O mapped access.
*/
@@ -3475,34 +3470,15 @@ tulip_rx_intr(
#endif /* TULIP_BUS_DMA */
eh = *mtod(ms, struct ether_header *);
+#ifndef __FreeBSD__
if (sc->tulip_if.if_bpf != NULL) {
if (me == ms)
bpf_tap(&sc->tulip_if, mtod(ms, caddr_t), total_len);
else
bpf_mtap(&sc->tulip_if, ms);
}
+#endif
sc->tulip_flags |= TULIP_RXACT;
-
-#ifdef BRIDGE /* see code in if_ed.c */
- ms->m_pkthdr.rcvif = ifp; /* XXX */
- ms->m_pkthdr.len = total_len; /* XXX */
- if (do_bridge) {
- struct ifnet *bdg_ifp ;
- bdg_ifp = bridge_in(ms);
- if (bdg_ifp == BDG_DROP)
- goto next ; /* and drop */
- if (bdg_ifp != BDG_LOCAL)
- bdg_forward(&ms, bdg_ifp);
- if (bdg_ifp != BDG_LOCAL && bdg_ifp != BDG_BCAST &&
- bdg_ifp != BDG_MCAST)
- goto next ; /* and drop */
- /* all others accepted locally */
- } else
-#endif
- if ((sc->tulip_flags & (TULIP_PROMISC|TULIP_HASHONLY))
- && (eh.ether_dhost[0] & 1) == 0
- && !TULIP_ADDREQUAL(eh.ether_dhost, sc->tulip_enaddr))
- goto next;
accept = 1;
} else {
ifp->if_ierrors++;
@@ -3551,7 +3527,6 @@ tulip_rx_intr(
#endif
#endif /* TULIP_BUS_DMA */
}
- next:
#if defined(TULIP_DEBUG)
cnt++;
#endif
diff --git a/sys/pci/if_fxp.c b/sys/pci/if_fxp.c
index 94ae0f1..b5de024 100644
--- a/sys/pci/if_fxp.c
+++ b/sys/pci/if_fxp.c
@@ -105,13 +105,6 @@
#define vtophys(va) alpha_XXX_dmamap((vm_offset_t)(va))
#endif /* __alpha__ */
-
-#include "opt_bdg.h"
-#ifdef BRIDGE
-#include <net/if_types.h>
-#include <net/bridge.h>
-#endif
-
/*
* NOTE! On the Alpha, we have an alignment constraint. The
* card DMAs the packet immediately following the RFA. However,
@@ -1169,53 +1162,13 @@ rcvloop:
goto rcvloop;
}
m->m_pkthdr.rcvif = ifp;
- m->m_pkthdr.len = m->m_len =
- total_len ;
+ m->m_pkthdr.len = m->m_len = total_len;
eh = mtod(m, struct ether_header *);
- if (ifp->if_bpf)
- bpf_tap(FXP_BPFTAP_ARG(ifp),
- mtod(m, caddr_t),
- total_len);
-#ifdef BRIDGE
- if (do_bridge) {
- struct ifnet *bdg_ifp ;
- bdg_ifp = bridge_in(m);
- if (bdg_ifp == BDG_DROP)
- goto dropit ;
- if (bdg_ifp != BDG_LOCAL)
- bdg_forward(&m, bdg_ifp);
- if (bdg_ifp != BDG_LOCAL &&
- bdg_ifp != BDG_BCAST &&
- bdg_ifp != BDG_MCAST)
- goto dropit ;
- goto getit ;
- }
-#endif
- /*
- * Only pass this packet up
- * if it is for us.
- */
- if ((ifp->if_flags &
- IFF_PROMISC) &&
- (rfa->rfa_status &
- FXP_RFA_STATUS_IAMATCH) &&
- (eh->ether_dhost[0] & 1)
- == 0) {
-#ifdef BRIDGE
-dropit:
-#endif
- if (m)
- m_freem(m);
- goto rcvloop;
- }
-#ifdef BRIDGE
-getit:
-#endif
m->m_data +=
sizeof(struct ether_header);
m->m_len -=
sizeof(struct ether_header);
- m->m_pkthdr.len = m->m_len ;
+ m->m_pkthdr.len = m->m_len;
ether_input(ifp, eh, m);
}
goto rcvloop;
diff --git a/sys/pci/if_rl.c b/sys/pci/if_rl.c
index b91b57d..0f04368 100644
--- a/sys/pci/if_rl.c
+++ b/sys/pci/if_rl.c
@@ -1163,23 +1163,6 @@ static void rl_rxeof(sc)
eh = mtod(m, struct ether_header *);
ifp->if_ipackets++;
- /*
- * Handle BPF listeners. Let the BPF user see the packet, but
- * don't pass it up to the ether_input() layer unless it's
- * a broadcast packet, multicast packet, matches our ethernet
- * address or the interface is in promiscuous mode.
- */
- if (ifp->if_bpf) {
- bpf_mtap(ifp, m);
- if (ifp->if_flags & IFF_PROMISC &&
- (bcmp(eh->ether_dhost, sc->arpcom.ac_enaddr,
- ETHER_ADDR_LEN) &&
- (eh->ether_dhost[0] & 1) == 0)) {
- m_freem(m);
- continue;
- }
- }
-
/* Remove header from mbuf and pass it on. */
m_adj(m, sizeof(struct ether_header));
ether_input(ifp, eh, m);
diff --git a/sys/pci/if_sf.c b/sys/pci/if_sf.c
index 5fb33a9..19432dc 100644
--- a/sys/pci/if_sf.c
+++ b/sys/pci/if_sf.c
@@ -1019,20 +1019,9 @@ static void sf_rxeof(sc)
eh = mtod(m, struct ether_header *);
ifp->if_ipackets++;
- if (ifp->if_bpf) {
- bpf_mtap(ifp, m);
- if (ifp->if_flags & IFF_PROMISC &&
- (bcmp(eh->ether_dhost, sc->arpcom.ac_enaddr,
- ETHER_ADDR_LEN) && !(eh->ether_dhost[0] & 1))) {
- m_freem(m);
- continue;
- }
- }
-
/* Remove header from mbuf and pass it on. */
m_adj(m, sizeof(struct ether_header));
ether_input(ifp, eh, m);
-
}
csr_write_4(sc, SF_CQ_CONSIDX,
diff --git a/sys/pci/if_sis.c b/sys/pci/if_sis.c
index 132fbf3..016edfa 100644
--- a/sys/pci/if_sis.c
+++ b/sys/pci/if_sis.c
@@ -908,22 +908,6 @@ static void sis_rxeof(sc)
ifp->if_ipackets++;
eh = mtod(m, struct ether_header *);
- /*
- * Handle BPF listeners. Let the BPF user see the packet, but
- * don't pass it up to the ether_input() layer unless it's
- * a broadcast packet, multicast packet, matches our ethernet
- * address or the interface is in promiscuous mode.
- */
- if (ifp->if_bpf) {
- bpf_mtap(ifp, m);
- if (ifp->if_flags & IFF_PROMISC &&
- (bcmp(eh->ether_dhost, sc->arpcom.ac_enaddr,
- ETHER_ADDR_LEN) && !(eh->ether_dhost[0] & 1))) {
- m_freem(m);
- continue;
- }
- }
-
/* Remove header from mbuf and pass it on. */
m_adj(m, sizeof(struct ether_header));
ether_input(ifp, eh, m);
diff --git a/sys/pci/if_sk.c b/sys/pci/if_sk.c
index ed923fa..4246b2a 100644
--- a/sys/pci/if_sk.c
+++ b/sys/pci/if_sk.c
@@ -1654,16 +1654,6 @@ static void sk_rxeof(sc_if)
ifp->if_ipackets++;
eh = mtod(m, struct ether_header *);
- if (ifp->if_bpf) {
- bpf_mtap(ifp, m);
- if (ifp->if_flags & IFF_PROMISC &&
- (bcmp(eh->ether_dhost, sc_if->arpcom.ac_enaddr,
- ETHER_ADDR_LEN) && !(eh->ether_dhost[0] & 1))) {
- m_freem(m);
- continue;
- }
- }
-
/* Remove header from mbuf and pass it on. */
m_adj(m, sizeof(struct ether_header));
ether_input(ifp, eh, m);
diff --git a/sys/pci/if_ste.c b/sys/pci/if_ste.c
index bb95150..033324c 100644
--- a/sys/pci/if_ste.c
+++ b/sys/pci/if_ste.c
@@ -48,11 +48,6 @@
#include <net/bpf.h>
-#include "opt_bdg.h"
-#ifdef BRIDGE
-#include <net/bridge.h>
-#endif
-
#include <vm/vm.h> /* for vtophys */
#include <vm/pmap.h> /* for vtophys */
#include <machine/clock.h> /* for DELAY */
@@ -730,38 +725,6 @@ again:
m->m_pkthdr.rcvif = ifp;
m->m_pkthdr.len = m->m_len = total_len;
- /* Handle BPF listeners. Let the BPF user see the packet. */
- if (ifp->if_bpf)
- bpf_mtap(ifp, m);
-
-#ifdef BRIDGE
- if (do_bridge) {
- struct ifnet *bdg_ifp ;
- bdg_ifp = bridge_in(m);
- if (bdg_ifp != BDG_LOCAL && bdg_ifp != BDG_DROP)
- bdg_forward(&m, bdg_ifp);
- if (((bdg_ifp != BDG_LOCAL) && (bdg_ifp != BDG_BCAST) &&
- (bdg_ifp != BDG_MCAST)) || bdg_ifp == BDG_DROP) {
- m_freem(m);
- continue;
- }
- }
-#endif
-
- /*
- * Don't pass packet up to the ether_input() layer unless it's
- * a broadcast packet, multicast packet, matches our ethernet
- * address or the interface is in promiscuous mode.
- */
- if (ifp->if_bpf) {
- if (ifp->if_flags & IFF_PROMISC &&
- (bcmp(eh->ether_dhost, sc->arpcom.ac_enaddr,
- ETHER_ADDR_LEN) && (eh->ether_dhost[0] & 1) == 0)){
- m_freem(m);
- continue;
- }
- }
-
/* Remove header from mbuf and pass it on. */
m_adj(m, sizeof(struct ether_header));
ether_input(ifp, eh, m);
diff --git a/sys/pci/if_ti.c b/sys/pci/if_ti.c
index de9c3bd..fe4c861 100644
--- a/sys/pci/if_ti.c
+++ b/sys/pci/if_ti.c
@@ -1851,23 +1851,6 @@ static void ti_rxeof(sc)
eh = mtod(m, struct ether_header *);
m->m_pkthdr.rcvif = ifp;
- /*
- * Handle BPF listeners. Let the BPF user see the packet, but
- * don't pass it up to the ether_input() layer unless it's
- * a broadcast packet, multicast packet, matches our ethernet
- * address or the interface is in promiscuous mode.
- */
- if (ifp->if_bpf) {
- bpf_mtap(ifp, m);
- if (ifp->if_flags & IFF_PROMISC &&
- (bcmp(eh->ether_dhost, sc->arpcom.ac_enaddr,
- ETHER_ADDR_LEN) &&
- (eh->ether_dhost[0] & 1) == 0)) {
- m_freem(m);
- continue;
- }
- }
-
/* Remove header from mbuf and pass it on. */
m_adj(m, sizeof(struct ether_header));
diff --git a/sys/pci/if_tl.c b/sys/pci/if_tl.c
index 28c4fab..c724fcd 100644
--- a/sys/pci/if_tl.c
+++ b/sys/pci/if_tl.c
@@ -1549,26 +1549,6 @@ static int tl_intvec_rxeof(xsc, type)
continue;
}
- /*
- * Handle BPF listeners. Let the BPF user see the packet, but
- * don't pass it up to the ether_input() layer unless it's
- * a broadcast packet, multicast packet, matches our ethernet
- * address or the interface is in promiscuous mode. If we don't
- * want the packet, just forget it. We leave the mbuf in place
- * since it can be used again later.
- */
- if (ifp->if_bpf) {
- m->m_pkthdr.len = m->m_len = total_len;
- bpf_mtap(ifp, m);
- if (ifp->if_flags & IFF_PROMISC &&
- (bcmp(eh->ether_dhost, sc->arpcom.ac_enaddr,
- ETHER_ADDR_LEN) &&
- (eh->ether_dhost[0] & 1) == 0)) {
- m_freem(m);
- continue;
- }
- }
-
/* Remove header from mbuf and pass it on. */
m->m_pkthdr.len = m->m_len =
total_len - sizeof(struct ether_header);
diff --git a/sys/pci/if_tx.c b/sys/pci/if_tx.c
index 0f37ca3..d575bca 100644
--- a/sys/pci/if_tx.c
+++ b/sys/pci/if_tx.c
@@ -52,7 +52,6 @@
#include <sys/queue.h>
#if defined(__FreeBSD__)
-#include "opt_bdg.h"
#define NBPFILTER 1
#include <net/if.h>
@@ -62,10 +61,6 @@
#include <net/bpf.h>
-#ifdef BRIDGE
-#include <net/bridge.h>
-#endif
-
#include <vm/vm.h> /* for vtophys */
#include <vm/pmap.h> /* for vtophys */
#include <machine/clock.h> /* for DELAY */
@@ -932,51 +927,6 @@ epic_rx_done(sc)
bpf_mtap( EPIC_BPFTAP_ARG(&sc->sc_if), m );
#endif /* NBPFILTER > 0 */
-#ifdef BRIDGE
- if (do_bridge) {
- struct ifnet *bdg_ifp ;
- bdg_ifp = bridge_in(m);
- if (bdg_ifp == BDG_DROP) {
- if (m)
- m_free(m);
- continue; /* and drop */
- }
- if (bdg_ifp != BDG_LOCAL)
- bdg_forward(&m, bdg_ifp);
- if (bdg_ifp != BDG_LOCAL && bdg_ifp != BDG_BCAST &&
- bdg_ifp != BDG_MCAST) {
- if (m)
- m_free(m);
- continue; /* and drop */
- }
- /* all others accepted locally */
- }
-#endif
-
-#if defined (__FreeBSD__)
- /*
- * This deserves explanation
- * If the bridge is _on_, then the following check
- * must not be done because occasionally the bridge
- * gets packets that are local but have the ethernet
- * address of one of the other interfaces.
- *
- * But if the bridge is off, then we have to drop
- * stuff that came in just via bpf.
- *
- * In OpenBSD such filter stands in ether_input. (?)
- */
- /* Accept only our packets, broadcasts and multicasts */
-#ifdef BRIDGE
- if (do_bridge)
-#endif
- if ((eh->ether_dhost[0] & 1) == 0 &&
- bcmp(eh->ether_dhost,sc->sc_macaddr,ETHER_ADDR_LEN)){
- m_freem(m);
- continue;
- }
-#endif
-
/* Second mbuf holds packet ifself */
m->m_pkthdr.len = m->m_len = len - sizeof(struct ether_header);
m->m_data += sizeof( struct ether_header );
diff --git a/sys/pci/if_vr.c b/sys/pci/if_vr.c
index 6e1ed0e..c28c207 100644
--- a/sys/pci/if_vr.c
+++ b/sys/pci/if_vr.c
@@ -75,11 +75,6 @@
#include <net/bpf.h>
-#include "opt_bdg.h"
-#ifdef BRIDGE
-#include <net/bridge.h>
-#endif /* BRIDGE */
-
#include <vm/vm.h> /* for vtophys */
#include <vm/pmap.h> /* for vtophys */
#include <machine/clock.h> /* for DELAY */
@@ -1045,37 +1040,6 @@ static void vr_rxeof(sc)
ifp->if_ipackets++;
eh = mtod(m, struct ether_header *);
- /*
- * Handle BPF listeners. Let the BPF user see the packet, but
- * don't pass it up to the ether_input() layer unless it's
- * a broadcast packet, multicast packet, matches our ethernet
- * address or the interface is in promiscuous mode.
- */
- if (ifp->if_bpf) {
- bpf_mtap(ifp, m);
- if (ifp->if_flags & IFF_PROMISC &&
- (bcmp(eh->ether_dhost, sc->arpcom.ac_enaddr,
- ETHER_ADDR_LEN) &&
- (eh->ether_dhost[0] & 1) == 0)) {
- m_freem(m);
- continue;
- }
- }
-
-#ifdef BRIDGE
- if (do_bridge) {
- struct ifnet *bdg_ifp;
- bdg_ifp = bridge_in(m);
- if (bdg_ifp != BDG_LOCAL && bdg_ifp != BDG_DROP)
- bdg_forward(&m, bdg_ifp);
- if (((bdg_ifp != BDG_LOCAL) && (bdg_ifp != BDG_BCAST) &&
- (bdg_ifp != BDG_MCAST)) || bdg_ifp == BDG_DROP) {
- m_freem(m);
- continue;
- }
- }
-#endif /* BRIDGE */
-
/* Remove header from mbuf and pass it on. */
m_adj(m, sizeof(struct ether_header));
ether_input(ifp, eh, m);
diff --git a/sys/pci/if_wb.c b/sys/pci/if_wb.c
index 168faf0..78d0c0a 100644
--- a/sys/pci/if_wb.c
+++ b/sys/pci/if_wb.c
@@ -102,10 +102,6 @@
#include <net/bpf.h>
-#ifdef BRIDGE
-#include <net/bridge.h>
-#endif
-
#include <vm/vm.h> /* for vtophys */
#include <vm/pmap.h> /* for vtophys */
#include <machine/clock.h> /* for DELAY */
@@ -1203,43 +1199,10 @@ static void wb_rxeof(sc)
ifp->if_ipackets++;
eh = mtod(m, struct ether_header *);
-#ifdef BRIDGE
- if (do_bridge) {
- struct ifnet *bdg_ifp;
- bdg_ifp = bridge_in(m);
- if (bdg_ifp != BDG_LOCAL && bdg_ifp != BDG_DROP)
- bdg_forward(&m, bdg_ifp);
- if (((bdg_ifp != BDG_LOCAL) && (bdg_ifp != BDG_BCAST) &&
- (bdg_ifp != BDG_MCAST)) || bdg_ifp == BDG_DROP) {
- m_freem(m);
- break;
- }
- }
-#endif
-
- /*
- * Handle BPF listeners. Let the BPF user see the packet, but
- * don't pass it up to the ether_input() layer unless it's
- * a broadcast packet, multicast packet, matches our ethernet
- * address or the interface is in promiscuous mode.
- */
- if (ifp->if_bpf) {
- bpf_mtap(ifp, m);
- if (ifp->if_flags & IFF_PROMISC &&
- (bcmp(eh->ether_dhost, sc->arpcom.ac_enaddr,
- ETHER_ADDR_LEN) &&
- (eh->ether_dhost[0] & 1) == 0)) {
- m_freem(m);
- break;
- }
- }
-
/* Remove header from mbuf and pass it on. */
m_adj(m, sizeof(struct ether_header));
ether_input(ifp, eh, m);
}
-
- return;
}
void wb_rxeoc(sc)
diff --git a/sys/pci/if_wx.c b/sys/pci/if_wx.c
index 387b246..fdd3c0e 100644
--- a/sys/pci/if_wx.c
+++ b/sys/pci/if_wx.c
@@ -1353,9 +1353,11 @@ wx_handle_rxint(sc)
for (idx = 0; idx < npkts; idx++) {
mb = pending[idx];
+#ifndef __FreeBSD__
if (ifp->if_bpf) {
bpf_mtap(WX_BPFTAP_ARG(ifp), mb);
}
+#endif
ifp->if_ipackets++;
if (sc->wx_debug) {
printf("%s: RECV packet length %d\n",
diff --git a/sys/pci/if_xl.c b/sys/pci/if_xl.c
index a03e138..8e4d41c 100644
--- a/sys/pci/if_xl.c
+++ b/sys/pci/if_xl.c
@@ -108,11 +108,6 @@
#include <net/bpf.h>
-#include "opt_bdg.h"
-#ifdef BRIDGE
-#include <net/bridge.h>
-#endif
-
#include <vm/vm.h> /* for vtophys */
#include <vm/pmap.h> /* for vtophys */
#include <machine/clock.h> /* for DELAY */
@@ -1770,38 +1765,6 @@ again:
m->m_pkthdr.rcvif = ifp;
m->m_pkthdr.len = m->m_len = total_len;
- /* Handle BPF listeners. Let the BPF user see the packet. */
- if (ifp->if_bpf)
- bpf_mtap(ifp, m);
-
-#ifdef BRIDGE
- if (do_bridge) {
- struct ifnet *bdg_ifp ;
- bdg_ifp = bridge_in(m);
- if (bdg_ifp != BDG_LOCAL && bdg_ifp != BDG_DROP)
- bdg_forward(&m, bdg_ifp);
- if (((bdg_ifp != BDG_LOCAL) && (bdg_ifp != BDG_BCAST) &&
- (bdg_ifp != BDG_MCAST)) || bdg_ifp == BDG_DROP) {
- m_freem(m);
- continue;
- }
- }
-#endif
-
- /*
- * Don't pass packet up to the ether_input() layer unless it's
- * a broadcast packet, multicast packet, matches our ethernet
- * address or the interface is in promiscuous mode.
- */
- if (ifp->if_bpf) {
- if (ifp->if_flags & IFF_PROMISC &&
- (bcmp(eh->ether_dhost, sc->arpcom.ac_enaddr,
- ETHER_ADDR_LEN) && (eh->ether_dhost[0] & 1) == 0)){
- m_freem(m);
- continue;
- }
- }
-
/* Remove header from mbuf and pass it on. */
m_adj(m, sizeof(struct ether_header));
ether_input(ifp, eh, m);
OpenPOWER on IntegriCloud