From: Roy Marples Date: Mon, 29 Jul 2019 12:31:23 +0000 (+0100) Subject: ND6: Disable advertising on OS other than NetBSD and Linux X-Git-Tag: v8.0.2~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1979159bbd89bd1793b513242cf420c57d2d0f98;p=thirdparty%2Fdhcpcd.git ND6: Disable advertising on OS other than NetBSD and Linux 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). --- diff --git a/src/ipv6.h b/src/ipv6.h index c4c3b1bf..220d220c 100644 --- a/src/ipv6.h +++ b/src/ipv6.h @@ -149,7 +149,13 @@ # 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 diff --git a/src/ipv6nd.c b/src/ipv6nd.c index 5968bb89..82135970 100644 --- a/src/ipv6nd.c +++ b/src/ipv6nd.c @@ -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,