diff options
author | archie <archie@FreeBSD.org> | 2000-05-14 02:18:43 +0000 |
---|---|---|
committer | archie <archie@FreeBSD.org> | 2000-05-14 02:18:43 +0000 |
commit | fa21035b4e2f11d2c8f90174690853600b670e2d (patch) | |
tree | 9afb8dacfff6d7607064d8aa2bbf2da5069e8be6 /sys/dev/fxp | |
parent | d066b073153b986a54fd18a31d6bcc5d697933a2 (diff) | |
download | FreeBSD-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/dev/fxp')
-rw-r--r-- | sys/dev/fxp/if_fxp.c | 51 |
1 files changed, 2 insertions, 49 deletions
diff --git a/sys/dev/fxp/if_fxp.c b/sys/dev/fxp/if_fxp.c index 94ae0f1..b5de024 100644 --- a/sys/dev/fxp/if_fxp.c +++ b/sys/dev/fxp/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; |