summaryrefslogtreecommitdiffstats
path: root/src/ipv6.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2017-08-26 15:08:04 +0100
committerRoy Marples <roy@marples.name>2017-08-26 15:08:04 +0100
commit1bfc4dabeceed0f749882fc35b33cc0492201c4e (patch)
tree227de975370e6bfede53f927c13c6e2e2e4ce5e7 /src/ipv6.c
parente92e049e18ab0d68a5b9ce3b4ca2da03c4310d74 (diff)
downloaddhcpcd-1bfc4dabeceed0f749882fc35b33cc0492201c4e.tar.xz
Don't create temporary addresses based off prefix in newaddr.
Diffstat (limited to 'src/ipv6.c')
-rw-r--r--src/ipv6.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/ipv6.c b/src/ipv6.c
index 61e5f23b..aeeac482 100644
--- a/src/ipv6.c
+++ b/src/ipv6.c
@@ -1452,6 +1452,7 @@ ipv6_newaddr(struct interface *ifp, struct in6_addr *addr, uint8_t prefix_len,
struct ipv6_addr *ia;
char buf[INET6_ADDRSTRLEN];
const char *cbp;
+ bool tempaddr;
ia = calloc(1, sizeof(*ia));
if (ia == NULL)
@@ -1462,7 +1463,13 @@ ipv6_newaddr(struct interface *ifp, struct in6_addr *addr, uint8_t prefix_len,
ia->addr_flags = IN6_IFF_TENTATIVE;
ia->prefix_len = prefix_len;
- if (ia->flags & IPV6_AF_AUTOCONF) {
+#ifdef IPV6_AF_TEMPORARY
+ tempaddr = ia->flags & IPV6_AF_TEMPORARY;
+#else
+ tempaddr = false;
+#endif
+
+ if (ia->flags & IPV6_AF_AUTOCONF && !tempaddr) {
ia->prefix = *addr;
ia->dadcounter = ipv6_makeaddr(&ia->addr, ifp,
&ia->prefix,