summaryrefslogtreecommitdiffstats
path: root/src/ipv6.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2019-07-28 16:10:36 +0000
committerRoy Marples <roy@marples.name>2019-07-28 16:10:36 +0000
commit149710d049175c3294360d55966d5868043c0171 (patch)
tree3c129e891a1e9a46062aada8c9b28abe963e6409 /src/ipv6.c
parent2092f07d88e50b7b6967b43429d79bd45e51b258 (diff)
downloaddhcpcd-149710d049175c3294360d55966d5868043c0171.tar.xz
Solaris: Avoid re-adding IPv6 addresses to preserve the prefix route
Really, kernels should just stop doing this, it's pointless.
Diffstat (limited to 'src/ipv6.c')
-rw-r--r--src/ipv6.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/ipv6.c b/src/ipv6.c
index f9eecf53..31a0cae0 100644
--- a/src/ipv6.c
+++ b/src/ipv6.c
@@ -634,6 +634,15 @@ ipv6_addaddr1(struct ipv6_addr *ia, const struct timespec *now)
#ifdef __sun
struct ipv6_state *state;
struct ipv6_addr *ia2;
+
+ /* If we re-add then address on Solaris then the prefix
+ * route will be scrubbed and re-added. Something might
+ * be using it, so let's avoid it. */
+ if (ia->flags & IPV6_AF_DADCOMPLETED) {
+ logdebugx("%s: IP address %s already exists",
+ ia->iface->name, ia->saddr);
+ return 0;
+ }
#endif
/* Remember the interface of the address. */
@@ -1187,6 +1196,8 @@ out:
/* Done with the ia now, so free it. */
if (cmd == RTM_DELADDR)
ipv6_freeaddr(ia);
+ else if (!(ia->addr_flags & IN6_IFF_NOTUSEABLE))
+ ia->flags |= IPV6_AF_DADCOMPLETED;
}
int
@@ -1465,8 +1476,10 @@ ipv6_newaddr(struct interface *ifp, const struct in6_addr *addr,
goto err;
ia->iface = ifp;
- ia->flags = IPV6_AF_NEW | flags;
ia->addr_flags = addr_flags;
+ ia->flags = IPV6_AF_NEW | flags;
+ if (!(ia->addr_flags & IN6_IFF_NOTUSEABLE))
+ ia->flags |= IPV6_AF_DADCOMPLETED;
ia->prefix_len = prefix_len;
ia->dhcp6_fd = -1;