summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Pascoe <pascoe@cvs.openbsd.org>2005-01-04 10:30:02 +0000
committerChristopher Pascoe <pascoe@cvs.openbsd.org>2005-01-04 10:30:02 +0000
commit18e8be30ac9a147ec66ad94e1447e74752d91dfc (patch)
tree73b6c4e08da8df0f90debacd2d3485d5bfb86a2a
parent124fa19ad1dc805cac088aadeddcbc5ce0e75921 (diff)
Move processing of ARP packets for CARP addresses to the carp interface
instead of processing them in the parent interface. This causes us to send ARP packets on a carpdev with its virtual MAC address as the source, rather than the parent's physical address. Permits us to fail over cleanly when connected to devices that use the source MAC address on a received ARP request to generate an ARP entry for the requesting host, rather than going through the who-has/is-at procedure. ok niklas@ mcbride@
-rw-r--r--sys/netinet/if_ether.c15
-rw-r--r--sys/netinet/ip_carp.c4
2 files changed, 8 insertions, 11 deletions
diff --git a/sys/netinet/if_ether.c b/sys/netinet/if_ether.c
index 6a8df9af4ad..aa1d7060d75 100644
--- a/sys/netinet/if_ether.c
+++ b/sys/netinet/if_ether.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_ether.c,v 1.56 2005/01/04 09:29:43 pascoe Exp $ */
+/* $OpenBSD: if_ether.c,v 1.57 2005/01/04 10:30:01 pascoe Exp $ */
/* $NetBSD: if_ether.c,v 1.31 1996/05/11 12:59:58 mycroft Exp $ */
/*
@@ -436,6 +436,11 @@ arpresolve(ac, rt, m, dst, desten)
arprequest(&ac->ac_if,
&(SIN(rt->rt_ifa->ifa_addr)->sin_addr.s_addr),
&(SIN(dst)->sin_addr.s_addr),
+#if NCARP > 0
+ (rt->rt_ifp->if_type == IFT_CARP) ?
+ ((struct arpcom *) rt->rt_ifp->if_softc
+ )->ac_enaddr :
+#endif
ac->ac_enaddr);
else {
rt->rt_flags |= RTF_REJECT;
@@ -555,14 +560,6 @@ in_arpinput(m)
m->m_pkthdr.rcvif->if_bridge == ia->ia_ifp->if_bridge)
bridge_ia = ia;
#endif
-
-#if NCARP > 0
- if (ac->ac_if.if_carp && ac->ac_if.if_type != IFT_CARP) {
- if (carp_iamatch(ac->ac_if.if_carp, ia,
- &isaddr, &enaddr))
- break;
- }
-#endif
}
#if NBRIDGE > 0
diff --git a/sys/netinet/ip_carp.c b/sys/netinet/ip_carp.c
index 41b7a47ab73..22b3be7434c 100644
--- a/sys/netinet/ip_carp.c
+++ b/sys/netinet/ip_carp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_carp.c,v 1.88 2004/12/22 06:04:33 pascoe Exp $ */
+/* $OpenBSD: ip_carp.c,v 1.89 2005/01/04 10:30:00 pascoe Exp $ */
/*
* Copyright (c) 2002 Michael Shalayeff. All rights reserved.
@@ -729,7 +729,7 @@ carp_clone_create(ifc, unit)
ifp->if_softc = sc;
snprintf(ifp->if_xname, sizeof ifp->if_xname, "%s%d", ifc->ifc_name,
unit);
- ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST | IFF_NOARP;
+ ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST;
ifp->if_ioctl = carp_ioctl;
ifp->if_start = carp_start;
ifp->if_output = carp_output;