Index: if_bridge.c =================================================================== --- if_bridge.c (revision 217833) +++ if_bridge.c (working copy) @@ -119,9 +119,6 @@ __FBSDID("$FreeBSD$"); #include #include #endif -#if defined(INET) || defined(INET6) -#include -#endif #include #include /* for struct arpcom */ #include @@ -2249,18 +2246,6 @@ bridge_input(struct ifnet *ifp, struct mbuf *m) return (m); } -#if (defined(INET) || defined(INET6)) -# define OR_CARP_CHECK_WE_ARE_DST(iface) \ - || ((iface)->if_carp \ - && (*carp_forus_p)((iface), eh->ether_dhost)) -# define OR_CARP_CHECK_WE_ARE_SRC(iface) \ - || ((iface)->if_carp \ - && (*carp_forus_p)((iface), eh->ether_shost)) -#else -# define OR_CARP_CHECK_WE_ARE_DST(iface) -# define OR_CARP_CHECK_WE_ARE_SRC(iface) -#endif - #ifdef INET6 # define OR_PFIL_HOOKED_INET6 \ || PFIL_HOOKED(&V_inet6_pfil_hook) @@ -2272,9 +2257,7 @@ bridge_input(struct ifnet *ifp, struct mbuf *m) if ((iface)->if_type == IFT_GIF) \ continue; \ /* It is destined for us. */ \ - if (memcmp(IF_LLADDR((iface)), eh->ether_dhost, ETHER_ADDR_LEN) == 0 \ - OR_CARP_CHECK_WE_ARE_DST((iface)) \ - ) { \ + if (memcmp(IF_LLADDR((iface)), eh->ether_dhost, ETHER_ADDR_LEN) == 0) { \ if ((iface)->if_type == IFT_BRIDGE) { \ ETHER_BPF_MTAP(iface, m); \ iface->if_ipackets++; \ @@ -2304,9 +2287,7 @@ bridge_input(struct ifnet *ifp, struct mbuf *m) } \ \ /* We just received a packet that we sent out. */ \ - if (memcmp(IF_LLADDR((iface)), eh->ether_shost, ETHER_ADDR_LEN) == 0 \ - OR_CARP_CHECK_WE_ARE_SRC((iface)) \ - ) { \ + if (memcmp(IF_LLADDR((iface)), eh->ether_shost, ETHER_ADDR_LEN) == 0) { \ BRIDGE_UNLOCK(sc); \ m_freem(m); \ return (NULL); \ @@ -2331,8 +2312,6 @@ bridge_input(struct ifnet *ifp, struct mbuf *m) GRAB_OUR_PACKETS(bif2->bif_ifp) } -#undef OR_CARP_CHECK_WE_ARE_DST -#undef OR_CARP_CHECK_WE_ARE_SRC #undef OR_PFIL_HOOKED_INET6 #undef GRAB_OUR_PACKETS Index: if_ethersubr.c =================================================================== --- if_ethersubr.c (revision 217833) +++ if_ethersubr.c (working copy) @@ -565,6 +565,7 @@ ether_input(struct ifnet *ifp, struct mbuf *m) { struct ether_header *eh; u_short etype; + int carp; if ((ifp->if_flags & IFF_UP) == 0) { m_freem(m); @@ -704,12 +705,14 @@ ether_input(struct ifnet *ifp, struct mbuf *m) } } + carp = (ifp->if_carp && (*carp_forus_p)(ifp, eh->ether_dhost)) ? 1 : 0; + /* * Allow if_bridge(4) to claim this frame. * The BRIDGE_INPUT() macro will update ifp if the bridge changed it * and the frame should be delivered locally. */ - if (ifp->if_bridge != NULL) { + if (ifp->if_bridge != NULL && carp == 0) { m->m_flags &= ~M_PROMISC; BRIDGE_INPUT(ifp, m); if (m == NULL) { @@ -729,7 +732,7 @@ ether_input(struct ifnet *ifp, struct mbuf *m) * TODO: Maintain a hash table of ethernet addresses other than * ether_dhost which may be active on this ifp. */ - if (ifp->if_carp && (*carp_forus_p)(ifp, eh->ether_dhost)) { + if (carp) { m->m_flags &= ~M_PROMISC; } else #endif