]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
ND6: Disable advertising on OS other than NetBSD and Linux
authorRoy Marples <roy@marples.name>
Mon, 29 Jul 2019 12:31:23 +0000 (13:31 +0100)
committerRoy Marples <roy@marples.name>
Mon, 29 Jul 2019 12:31:23 +0000 (13:31 +0100)
It's only used for IP6 address sharing to prefer an interface,
but this only works on NetBSD. It might work on Linux too.
For all other OS advertising either fails to work (OpenBSD)
or erroneously logs duplicate address messages (all other BSD's).

src/ipv6.h
src/ipv6nd.c

index c4c3b1bf7f109a3c99cce7d76680c8b5aa3b2782..220d220ca1d0f43df5430c5bcbaeeb720e43d9f6 100644 (file)
 #  define IN6_IFF_DETACHED     0
 #endif
 
-#ifndef SMALL
+/*
+ * ND6 Advertising is only used for IP address sharing to prefer
+ * the address on a specific interface.
+ * This just fails to work on OpenBSD and causes erroneous duplicate
+ * address messages on BSD's other then NetBSD.
+ */
+#if !defined(SMALL) && (defined(__NetBSD__) || defined(__linux__))
 #  define ND6_ADVERTISE
 #endif
 
index 5968bb891cecb72925ceb35f21d7c0a1ac9a4e94..82135970870ad8d279dbaa642d38b47b1d18e90b 100644 (file)
@@ -434,13 +434,7 @@ ipv6nd_sendadvertisement(void *arg)
        s = ctx->nd_fd;
 #endif
        if (sendmsg(s, &msg, 0) == -1)
-#ifdef __OpenBSD__
-/* This isn't too critical as they don't support IPv6 address sharing */
-#warning Cannot send NA messages on OpenBSD
-               logdebug(__func__);
-#else
                logerr(__func__);
-#endif
 
        if (++ia->na_count < MAX_NEIGHBOR_ADVERTISEMENT) {
                eloop_timeout_add_sec(ctx->eloop,