diff options
-rw-r--r-- | sys/modules/if_bridge/Makefile | 2 | ||||
-rw-r--r-- | sys/net/if_bridge.c | 18 |
2 files changed, 17 insertions, 3 deletions
diff --git a/sys/modules/if_bridge/Makefile b/sys/modules/if_bridge/Makefile index d1fc350..df3316a 100644 --- a/sys/modules/if_bridge/Makefile +++ b/sys/modules/if_bridge/Makefile @@ -4,7 +4,7 @@ .PATH: ${.CURDIR}/../../net KMOD= if_bridge -SRCS= if_bridge.c bridgestp.c opt_inet.h opt_inet6.h +SRCS= if_bridge.c bridgestp.c opt_inet.h opt_inet6.h opt_carp.h .if !defined(KERNBUILDDIR) opt_inet.h: diff --git a/sys/net/if_bridge.c b/sys/net/if_bridge.c index 065ec75..c2c30c3 100644 --- a/sys/net/if_bridge.c +++ b/sys/net/if_bridge.c @@ -84,6 +84,7 @@ __FBSDID("$FreeBSD$"); #include "opt_inet.h" #include "opt_inet6.h" +#include "opt_carp.h" #include <sys/param.h> #include <sys/mbuf.h> @@ -120,6 +121,9 @@ __FBSDID("$FreeBSD$"); #include <netinet/ip6.h> #include <netinet6/ip6_var.h> #endif +#ifdef DEV_CARP +#include <netinet/ip_carp.h> +#endif #include <machine/in_cksum.h> #include <netinet/if_ether.h> /* for struct arpcom */ #include <net/if_bridgevar.h> @@ -2039,7 +2043,12 @@ bridge_input(struct ifnet *ifp, struct mbuf *m) continue; /* It is destined for us. */ if (memcmp(IF_LLADDR(bif->bif_ifp), eh->ether_dhost, - ETHER_ADDR_LEN) == 0) { + ETHER_ADDR_LEN) == 0 +#ifdef DEV_CARP + || (bif->bif_ifp->if_carp + && carp_forus(bif->bif_ifp->if_carp, eh->ether_dhost)) +#endif + ) { if (bif->bif_flags & IFBIF_LEARNING) (void) bridge_rtupdate(sc, eh->ether_shost, ifp, 0, IFBAF_DYNAMIC); @@ -2050,7 +2059,12 @@ bridge_input(struct ifnet *ifp, struct mbuf *m) /* We just received a packet that we sent out. */ if (memcmp(IF_LLADDR(bif->bif_ifp), eh->ether_shost, - ETHER_ADDR_LEN) == 0) { + ETHER_ADDR_LEN) == 0 +#ifdef DEV_CARP + || (bif->bif_ifp->if_carp + && carp_forus(bif->bif_ifp->if_carp, eh->ether_shost)) +#endif + ) { BRIDGE_UNLOCK(sc); m_freem(m); return (NULL); |