From: mpi Date: Thu, 8 Jan 2015 10:55:45 +0000 (+0000) Subject: Do not unconditionally set a link-local address. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=2c6d939c0d842b76397ea6eb88a8a9c767fb4e88;p=openbsd Do not unconditionally set a link-local address. carp(4) has a hack to update its Ethernet address which was also generating the corresponding IPv6 link-local address. Since the removal of the NOINET6 flag, this link-local address was generated even if no IPv6 address has been configured on the interface. This unbreak carp setup without v6 addresses, found the hard way by sebastia@. ok sebastia@, benno@, stsp@, @phessler --- diff --git a/sys/netinet/ip_carp.c b/sys/netinet/ip_carp.c index 92d822270ca..3f93c7ec051 100644 --- a/sys/netinet/ip_carp.c +++ b/sys/netinet/ip_carp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip_carp.c,v 1.243 2014/12/19 17:14:40 tedu Exp $ */ +/* $OpenBSD: ip_carp.c,v 1.244 2015/01/08 10:55:45 mpi Exp $ */ /* * Copyright (c) 2002 Michael Shalayeff. All rights reserved. @@ -1785,7 +1785,8 @@ carp_set_enaddr(struct carp_softc *sc) * (re)attach a link-local address which matches * our new MAC address. */ - in6_ifattach_linklocal(&sc->sc_if, NULL); + if (sc->sc_naddrs6) + in6_ifattach_linklocal(&sc->sc_if, NULL); #endif carp_set_state_all(sc, INIT); carp_setrun_all(sc, 0);