From: Roy Marples Date: Mon, 5 Sep 2016 15:57:30 +0000 (+0000) Subject: Ensure that the IPv6 link-local address always uses the secret key at startup. X-Git-Tag: v6.11.4~51 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fa8901d4d5687572d8ff62e2ffd9614783d6d6a9;p=thirdparty%2Fdhcpcd.git Ensure that the IPv6 link-local address always uses the secret key at startup. --- diff --git a/ipv6.c b/ipv6.c index 93ce3dd7..0df156ca 100644 --- a/ipv6.c +++ b/ipv6.c @@ -339,6 +339,11 @@ ipv6_makestableprivate(struct in6_addr *addr, uint32_t dad; int r; + if (ifp->ctx->secret_len == 0) { + if (ipv6_readsecret(ifp->ctx) == -1) + return -1; + } + dad = (uint32_t)*dad_counter; /* For our implementation, we shall set the hardware address @@ -367,10 +372,6 @@ ipv6_makeaddr(struct in6_addr *addr, struct interface *ifp, } if (ifp->options->options & DHCPCD_SLAACPRIVATE) { - if (ifp->ctx->secret_len == 0) { - if (ipv6_readsecret(ifp->ctx) == -1) - return -1; - } dad = 0; if (ipv6_makestableprivate(addr, prefix, prefix_len, ifp, &dad) == -1)