From: Roy Marples Date: Wed, 4 Oct 2023 16:38:08 +0000 (+0100) Subject: DHCP6: Set all requested addrs as not stale when starting discovery X-Git-Tag: v10.0.3~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d2870904968be9ec9613f894c8d12cb13d431641;p=thirdparty%2Fdhcpcd.git DHCP6: Set all requested addrs as not stale when starting discovery Hopefully fixes #249. --- diff --git a/src/dhcp6.c b/src/dhcp6.c index 7e5b66cd..63fe2dc6 100644 --- a/src/dhcp6.c +++ b/src/dhcp6.c @@ -1630,6 +1630,7 @@ dhcp6_startdiscover(void *arg) struct interface *ifp; struct dhcp6_state *state; int llevel; + struct ipv6_addr *ia; ifp = arg; state = D6_STATE(ifp); @@ -1654,6 +1655,14 @@ dhcp6_startdiscover(void *arg) state->new = NULL; state->new_len = 0; + /* If we fail to renew or confirm, our requested addreses will + * be marked as stale. + To re-request them, just mark them as not stale. */ + TAILQ_FOREACH(ia, &state->addrs, next) { + if (ia->flags & IPV6_AF_REQUEST) + ia->flags &= ~IPV6_AF_STALE; + } + if (dhcp6_makemessage(ifp) == -1) logerr("%s: %s", __func__, ifp->name); else @@ -2270,9 +2279,7 @@ dhcp6_findpd(struct interface *ifp, const uint8_t *iaid, } else { if (!(a->flags & IPV6_AF_DELEGATEDPFX)) a->flags |= IPV6_AF_NEW | IPV6_AF_DELEGATEDPFX; - a->flags &= ~(IPV6_AF_STALE | - IPV6_AF_EXTENDED | - IPV6_AF_REQUEST); + a->flags &= ~(IPV6_AF_STALE | IPV6_AF_EXTENDED); if (a->prefix_vltime != pdp.vltime) a->flags |= IPV6_AF_NEW; }