summaryrefslogtreecommitdiff
path: root/sys/netinet
diff options
context:
space:
mode:
authorMartin Pieuchot <mpi@cvs.openbsd.org>2014-02-13 10:31:43 +0000
committerMartin Pieuchot <mpi@cvs.openbsd.org>2014-02-13 10:31:43 +0000
commit7abe5bc33029d430bfd0685140d13f461614de97 (patch)
treec6cd82cb3967b22d58c9254c54a1c1121bf8cd71 /sys/netinet
parent24a2cafc414e23e2479dcc79094734c6998fdd48 (diff)
When sending a neighbor advertisement, correctly use the carp mac
address and not the mac of the physical interface as target lladdr. This allows us to get rid of the hack adding and removing the route to loopback of a carp node when its status switch to master and backup respectively. Now the route entry will no longer be updated to use the mac address of the physical interface of the master node as gateway. While here send the ARP request through the carp interface for consistency. Analysed with and ok mikeb@, ok bluhm@
Diffstat (limited to 'sys/netinet')
-rw-r--r--sys/netinet/ip_carp.c17
1 files changed, 3 insertions, 14 deletions
diff --git a/sys/netinet/ip_carp.c b/sys/netinet/ip_carp.c
index 3cd6c94662c..0f383fc90ed 100644
--- a/sys/netinet/ip_carp.c
+++ b/sys/netinet/ip_carp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_carp.c,v 1.221 2014/02/07 22:22:37 stsp Exp $ */
+/* $OpenBSD: ip_carp.c,v 1.222 2014/02/13 10:31:42 mpi Exp $ */
/*
* Copyright (c) 2002 Michael Shalayeff. All rights reserved.
@@ -509,17 +509,6 @@ carp_setroute(struct carp_softc *sc, int cmd)
}
break;
}
-
-#ifdef INET6
- case AF_INET6:
- if (sc->sc_balancing >= CARP_BAL_IP)
- continue;
- if (cmd == RTM_ADD)
- in6_ifaddloop(ifa);
- else
- in6_ifremloop(ifa);
- break;
-#endif /* INET6 */
default:
break;
}
@@ -1330,7 +1319,7 @@ carp_send_arp(struct carp_softc *sc)
continue;
in = ifatoia(ifa)->ia_addr.sin_addr.s_addr;
- arprequest(sc->sc_carpdev, &in, &in, sc->sc_ac.ac_enaddr);
+ arprequest(&sc->sc_if, &in, &in, sc->sc_ac.ac_enaddr);
DELAY(1000); /* XXX */
}
splx(s);
@@ -1351,7 +1340,7 @@ carp_send_na(struct carp_softc *sc)
continue;
in6 = &ifatoia6(ifa)->ia_addr.sin6_addr;
- nd6_na_output(sc->sc_carpdev, &mcast, in6,
+ nd6_na_output(&sc->sc_if, &mcast, in6,
ND_NA_FLAG_OVERRIDE |
(ip6_forwarding ? ND_NA_FLAG_ROUTER : 0), 1, NULL);
DELAY(1000); /* XXX */