From: Roy Marples Date: Wed, 1 Apr 2020 15:12:37 +0000 (+0100) Subject: Note that setting pltime to zero for stale addresses isn't RFC compliant X-Git-Tag: v9.0.0~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1fd4924320856c8d83d99897d0f2e3492834e576;p=thirdparty%2Fdhcpcd.git Note that setting pltime to zero for stale addresses isn't RFC compliant But also note we need to do this to ensure the kernel tries to use better addresses. --- diff --git a/src/dhcp6.c b/src/dhcp6.c index 129d5f0e..d345b834 100644 --- a/src/dhcp6.c +++ b/src/dhcp6.c @@ -2416,6 +2416,9 @@ dhcp6_deprecateaddrs(struct ipv6_addrhead *addrs) if (ia->prefix_vltime != 0) logdebugx("%s: %s: became stale", ia->iface->name, ia->saddr); + /* Technically this violates RFC 8415 18.2.10.1, + * but we need a mechanism to tell the kernel to + * try and prefer other addresses. */ ia->prefix_pltime = 0; } else if (ia->prefix_vltime == 0) loginfox("%s: %s: no valid lifetime", diff --git a/src/ipv6nd.c b/src/ipv6nd.c index ba4eb8ca..2860e67c 100644 --- a/src/ipv6nd.c +++ b/src/ipv6nd.c @@ -1422,6 +1422,9 @@ ipv6nd_handlera(struct dhcpcd_ctx *ctx, continue; ipv6nd_findmarkstale(rap, ia, true); logdebugx("%s: %s: became stale", ifp->name, ia->saddr); + /* Technically this violates RFC 4861 6.3.4, + * but we need a mechanism to tell the kernel to + * try and prefer other addresses. */ ia->prefix_pltime = 0; }