diff --git a/sys/dev/vr/if_vr.c b/sys/dev/vr/if_vr.c index cae329a5761d..1e47ec18ed24 100644 --- a/sys/dev/vr/if_vr.c +++ b/sys/dev/vr/if_vr.c @@ -79,6 +79,11 @@ #include #endif +#include "opt_bdg.h" +#ifdef BRIDGE +#include +#endif /* BRIDGE */ + #include /* for vtophys */ #include /* for vtophys */ #include /* for DELAY */ @@ -1415,7 +1420,21 @@ static void vr_rxeof(sc) continue; } } -#endif +#endif /* NBPF>0 */ +#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_vr.c b/sys/pci/if_vr.c index cae329a5761d..1e47ec18ed24 100644 --- a/sys/pci/if_vr.c +++ b/sys/pci/if_vr.c @@ -79,6 +79,11 @@ #include #endif +#include "opt_bdg.h" +#ifdef BRIDGE +#include +#endif /* BRIDGE */ + #include /* for vtophys */ #include /* for vtophys */ #include /* for DELAY */ @@ -1415,7 +1420,21 @@ static void vr_rxeof(sc) continue; } } -#endif +#endif /* NBPF>0 */ +#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);