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;
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
" 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 */
#endif
#ifdef ND6_ADVERTISE
+advertise:
/* Re-advertise the preferred address to be safe. */
if (!vltime_was_zero)
ipv6nd_advertise(ia);
#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
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;