summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Pieuchot <mpi@cvs.openbsd.org>2016-07-19 16:08:47 +0000
committerMartin Pieuchot <mpi@cvs.openbsd.org>2016-07-19 16:08:47 +0000
commit040e35dab3fc0f96d3a3adff0f0cfe4fc555c843 (patch)
tree5b0c46b9ed0cf628dc4c3e28e1f9e505e52bdf91
parent3b6d3f3e34dc98a5496ee3aca75b3492565968c4 (diff)
Fix the check supposed to prevent 'ip' and 'ip-stealth' balancing modes
from leaking the multicast address. beck@ found the hard way that this made his second CARP master use a wrong MAC address. This is part of a bigger diff from Florian Riehm who is currently working on a proper solution to fix balancing modes. ok beck@, bluhm@
-rw-r--r--sys/netinet/ip_carp.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/sys/netinet/ip_carp.c b/sys/netinet/ip_carp.c
index e8063c7fe69..5767fd1a6f3 100644
--- a/sys/netinet/ip_carp.c
+++ b/sys/netinet/ip_carp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_carp.c,v 1.291 2016/06/06 07:01:37 mpi Exp $ */
+/* $OpenBSD: ip_carp.c,v 1.292 2016/07/19 16:08:46 mpi Exp $ */
/*
* Copyright (c) 2002 Michael Shalayeff. All rights reserved.
@@ -2281,14 +2281,13 @@ carp_start(struct ifnet *ifp)
* advertisements in 'ip' and 'ip-stealth' balacing
* modes.
*/
- if (sc->sc_balancing != CARP_BAL_IPSTEALTH &&
- sc->sc_balancing != CARP_BAL_IP &&
- (sc->cur_vhe && !sc->cur_vhe->vhe_leader)) {
+ if (sc->sc_balancing == CARP_BAL_IP ||
+ sc->sc_balancing == CARP_BAL_IPSTEALTH) {
struct ether_header *eh;
uint8_t *esrc;
eh = mtod(m, struct ether_header *);
- esrc = sc->cur_vhe->vhe_enaddr;
+ esrc = ((struct arpcom*)ifp->if_carpdev)->ac_enaddr;;
memcpy(eh->ether_shost, esrc, sizeof(eh->ether_shost));
}