From: Roy Marples Date: Wed, 12 Jun 2019 12:43:27 +0000 (+0100) Subject: DHCP6: Keep running regardless of RA state X-Git-Tag: v7.2.3~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=364d43e78b8155016099135c6ea9380114de3f08;p=thirdparty%2Fdhcpcd.git DHCP6: Keep running regardless of RA state We should keep DHCP6 running even if routers expire or link changes. This is noted in RFC3315 18.1.2: If the client receives no responses before the message transmission process terminates, as described in section 14, the client SHOULD continue to use any IP addresses, using the last known lifetimes for those addresses, and SHOULD continue to use any other previously obtained configuration parameters. --- diff --git a/src/dhcp6.c b/src/dhcp6.c index 7f26129f..e977e475 100644 --- a/src/dhcp6.c +++ b/src/dhcp6.c @@ -3934,21 +3934,6 @@ dhcp6_free(struct interface *ifp) dhcp6_freedrop(ifp, 0, NULL); } -void -dhcp6_dropnondelegates(struct interface *ifp) -{ - -#ifndef SMALL - if (dhcp6_hasprefixdelegation(ifp)) - return; -#endif - if (D6_CSTATE(ifp) == NULL) - return; - - loginfox("%s: dropping DHCPv6 due to no valid routers", ifp->name); - dhcp6_drop(ifp, "EXPIRE6"); -} - void dhcp6_abort(struct interface *ifp) { diff --git a/src/dhcp6.h b/src/dhcp6.h index a670566d..8853d7f8 100644 --- a/src/dhcp6.h +++ b/src/dhcp6.h @@ -235,7 +235,6 @@ void dhcp6_handleifa(int, struct ipv6_addr *, pid_t); int dhcp6_dadcompleted(const struct interface *); void dhcp6_abort(struct interface *); void dhcp6_drop(struct interface *, const char *); -void dhcp6_dropnondelegates(struct interface *ifp); int dhcp6_dump(struct interface *); #endif /* DHCP6 */ diff --git a/src/ipv6nd.c b/src/ipv6nd.c index b5e503cc..947257ad 100644 --- a/src/ipv6nd.c +++ b/src/ipv6nd.c @@ -382,9 +382,6 @@ ipv6nd_sendrsprobe(void *arg) else { logwarnx("%s: no IPv6 Routers available", ifp->name); ipv6nd_drop(ifp); -#ifdef DHCP6 - dhcp6_dropnondelegates(ifp); -#endif } } @@ -1525,9 +1522,6 @@ ipv6nd_expirera(void *arg) struct timespec now, lt, expire, next; bool expired, valid, validone; struct ipv6_addr *ia; -#ifdef DHCP6 - bool anyvalid = false; -#endif ifp = arg; clock_gettime(CLOCK_MONOTONIC, &now); @@ -1603,10 +1597,6 @@ ipv6nd_expirera(void *arg) * as well punt it. */ if (!valid && !validone) ipv6nd_free_ra(rap); -#ifdef DHCP6 - else - anyvalid = true; -#endif } if (timespecisset(&next)) @@ -1616,12 +1606,6 @@ ipv6nd_expirera(void *arg) rt_build(ifp->ctx, AF_INET6); script_runreason(ifp, "ROUTERADVERT"); } - -#ifdef DHCP6 - /* No valid routers? Kill any DHCPv6. */ - if (!anyvalid) - dhcp6_dropnondelegates(ifp); -#endif } void