From: Roy Marples Date: Wed, 4 Sep 2019 01:34:23 +0000 (+0300) Subject: Solaris: Sending NA now seems to work! X-Git-Tag: v8.0.4~13 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f95d685e476cfdcc29d33e754f77e7e44dfdf303;p=thirdparty%2Fdhcpcd.git Solaris: Sending NA now seems to work! --- diff --git a/src/ipv6.c b/src/ipv6.c index ffc12ac3..2275c90b 100644 --- a/src/ipv6.c +++ b/src/ipv6.c @@ -629,7 +629,7 @@ ipv6_addaddr1(struct ipv6_addr *ia, const struct timespec *now) uint32_t pltime, vltime; __printflike(1, 2) void (*logfunc)(const char *, ...); #ifdef ND6_ADVERTISE - bool vltime_was_zero; + bool vltime_was_zero = ia->prefix_vltime == 0; #endif #ifdef __sun struct ipv6_state *state; @@ -641,7 +641,11 @@ ipv6_addaddr1(struct ipv6_addr *ia, const struct timespec *now) if (ia->flags & IPV6_AF_DADCOMPLETED) { logdebugx("%s: IP address %s already exists", ia->iface->name, ia->saddr); +#ifdef ND6_ADVERTISE + goto advertise; +#else return 0; +#endif } #endif @@ -707,9 +711,6 @@ ipv6_addaddr1(struct ipv6_addr *ia, const struct timespec *now) " seconds", ifp->name, ia->prefix_pltime, ia->prefix_vltime); -#ifdef ND6_ADVERTISE - vltime_was_zero = ia->prefix_vltime == 0; -#endif if (if_address6(RTM_NEWADDR, ia) == -1) { logerr(__func__); /* Restore real pltime and vltime */ @@ -774,6 +775,7 @@ ipv6_addaddr1(struct ipv6_addr *ia, const struct timespec *now) #endif #ifdef ND6_ADVERTISE +advertise: /* Re-advertise the preferred address to be safe. */ if (!vltime_was_zero) ipv6nd_advertise(ia); diff --git a/src/ipv6.h b/src/ipv6.h index fe2f01a6..7dbf4fe6 100644 --- a/src/ipv6.h +++ b/src/ipv6.h @@ -159,7 +159,7 @@ #if !defined(SMALL) && \ ((defined(__DragonFly_version) && __DragonFly_version >= 500703) || \ (defined(__NetBSD_Version__) && __NetBSD_Version__ >= 899002800) || \ - defined(__linux__)) + defined(__linux__) || defined(__sun)) # define ND6_ADVERTISE #endif diff --git a/src/ipv6nd.c b/src/ipv6nd.c index 35401b75..affc9117 100644 --- a/src/ipv6nd.c +++ b/src/ipv6nd.c @@ -459,6 +459,11 @@ ipv6nd_advertise(struct ipv6_addr *ia) if (IN6_IS_ADDR_MULTICAST(&ia->addr)) return; +#ifdef __sun + if (!(ia->flags & IPV6_AF_AUTOCONF) && ia->flags & IPV6_AF_RAPFX) + return; +#endif + ctx = ia->iface->ctx; /* Find the most preferred address to advertise. */ iaf = NULL;