From fa8901d4d5687572d8ff62e2ffd9614783d6d6a9 Mon Sep 17 00:00:00 2001 From: Roy Marples Date: Mon, 5 Sep 2016 15:57:30 +0000 Subject: [PATCH] Ensure that the IPv6 link-local address always uses the secret key at startup. --- ipv6.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) 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) -- 2.47.2