Do not unconditionally set a link-local address.
authormpi <mpi@openbsd.org>
Thu, 8 Jan 2015 10:55:45 +0000 (10:55 +0000)
committermpi <mpi@openbsd.org>
Thu, 8 Jan 2015 10:55:45 +0000 (10:55 +0000)
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

sys/netinet/ip_carp.c

index 92d8222..3f93c7e 100644 (file)
@@ -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);