]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Solaris: Sending NA now seems to work!
authorRoy Marples <roy@marples.name>
Wed, 4 Sep 2019 01:34:23 +0000 (04:34 +0300)
committerRoy Marples <roy@marples.name>
Wed, 4 Sep 2019 01:34:23 +0000 (04:34 +0300)
src/ipv6.c
src/ipv6.h
src/ipv6nd.c

index ffc12ac3623957ffff0a8bce133b86f862ae0381..2275c90b116ab4cd7c342483317f3d0fba4756c8 100644 (file)
@@ -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);
index fe2f01a6ec47e7794b2d8655884dd5443b7ec171..7dbf4fe69248cfbc9cd055d199032afeb1eed2ea 100644 (file)
 #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
 
index 35401b75c4dba552b15bbd640f863dd0127803a8..affc911708b325c801137ac1e497caa965e68569 100644 (file)
@@ -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;