X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=src%2Fdhcpv6.c;h=f1122bddabbc44333961736a8480fcffb4dfb853;hb=6bdec649886d077620f4b3004782dee662f90c14;hp=21f0b22256702243ed223b30fa098799fab65fc7;hpb=f383c982bc8dee2ffd4b447f2862a9c0f87fa582;p=odhcp6c.git diff --git a/src/dhcpv6.c b/src/dhcpv6.c index 21f0b22..f1122bd 100644 --- a/src/dhcpv6.c +++ b/src/dhcpv6.c @@ -313,7 +313,7 @@ int dhcpv6_request(enum dhcpv6_msg type) syslog(LOG_NOTICE, "Sending %s (timeout %us)", retx->name, timeout); - uint64_t start = adhc6c_get_milli_time(), round_start = start, elapsed; + uint64_t start = odhcp6c_get_milli_time(), round_start = start, elapsed; // Generate transaction ID uint8_t trid[3]; @@ -344,7 +344,7 @@ int dhcpv6_request(enum dhcpv6_msg type) // Receive rounds for (; len < 0 && round_start < round_end; - round_start = adhc6c_get_milli_time()) { + round_start = odhcp6c_get_milli_time()) { // Check for pending signal if (odhcp6c_signal_is_pending()) return -1; @@ -365,7 +365,7 @@ int dhcpv6_request(enum dhcpv6_msg type) uint8_t *opt = &buf[4]; uint8_t *opt_end = opt + len - 4; - round_start = adhc6c_get_milli_time(); + round_start = odhcp6c_get_milli_time(); elapsed = round_start - start; syslog(LOG_NOTICE, "Got a valid reply after " "%ums", (unsigned)elapsed); @@ -629,6 +629,10 @@ static int dhcpv6_handle_reply(_unused enum dhcpv6_msg orig, if (l_t2 > 0 && t2 > l_t2) t2 = l_t2; + // Always report update in case we have IA_PDs so that + // the state-script is called with updated times + if (otype == DHCPV6_OPT_IA_PD && request_prefix) + have_update = true; time_t n = dhcpv6_parse_ia(&ia_hdr[1], odata + olen);