*** if_tx.c.orig Mon Dec 14 01:32:56 1998 --- if_tx.c Sat Jun 26 19:54:49 1999 *************** *** 135,140 **** --- 135,147 ---- #include #include + + #include "opt_bdg.h" + + #ifdef BRIDGE + #include + #endif + #endif #if defined(__FreeBSD__) *************** *** 907,913 **** --- 914,950 ---- #else /* __OpenBSD__ */ bpf_mtap( sc->sc_if.if_bpf, m ); #endif /* __FreeBSD__ */ + #endif /* NBPFILTER */ + + #ifdef BRIDGE + if (do_bridge) { + struct ifnet *bdg_ifp ; + bdg_ifp = bridge_in(m); + if (bdg_ifp == BDG_DROP) { + 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) { + /* m_free(m); bdg_forward consumed it */ + continue; /* and drop */ + } + /* all others accepted locally */ + } + #if NBPFILTER > 0 + else { + if( (eh->ether_dhost[0] & 1) == 0 && + bcmp(eh->ether_dhost,sc->sc_macaddr,ETHER_ADDR_LEN)){ + m_freem(m); + continue; + } + } + #endif + #endif + #if NBPFILTER > 0 && !defined(BRIDGE) /* Accept only our packets, broadcasts and multicasts */ if( (eh->ether_dhost[0] & 1) == 0 && bcmp(eh->ether_dhost,sc->sc_macaddr,ETHER_ADDR_LEN)){