summaryrefslogtreecommitdiffstats
path: root/sys/net/if_bridge.c
diff options
context:
space:
mode:
authorthompsa <thompsa@FreeBSD.org>2006-06-08 23:40:16 +0000
committerthompsa <thompsa@FreeBSD.org>2006-06-08 23:40:16 +0000
commitba4d1fc19e7cc006990130215e62b3109151634e (patch)
tree7352680a7e1ead70182e637634d961e81e3b5703 /sys/net/if_bridge.c
parent1b190106336017a3e2be9573027196fe734e1c36 (diff)
downloadFreeBSD-src-ba4d1fc19e7cc006990130215e62b3109151634e.zip
FreeBSD-src-ba4d1fc19e7cc006990130215e62b3109151634e.tar.gz
Allow bridge and carp to play nicely together by returning the packet if its
destined for a carp interface. Obtained from: OpenBSD MFC after: 2 weeks
Diffstat (limited to 'sys/net/if_bridge.c')
-rw-r--r--sys/net/if_bridge.c18
1 files changed, 16 insertions, 2 deletions
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);
OpenPOWER on IntegriCloud