From: mpi Date: Tue, 19 Jul 2016 16:08:46 +0000 (+0000) Subject: Fix the check supposed to prevent 'ip' and 'ip-stealth' balancing modes X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=074f323e9e5c320daf477baf2c270a9a397249a5;p=openbsd 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@ --- 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)); }