changeset 4525:2b33154f3442 draft

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.
author Roy Marples <roy@marples.name>
date Wed, 12 Jun 2019 13:43:27 +0100
parents 707d58bf0352
children 1181a1e7da7d
files src/dhcp6.c src/dhcp6.h src/ipv6nd.c
diffstat 3 files changed, 0 insertions(+), 32 deletions(-) [+]
line wrap: on
line diff
--- a/src/dhcp6.c	Sat May 04 14:29:28 2019 +0100
+++ b/src/dhcp6.c	Wed Jun 12 13:43:27 2019 +0100
@@ -3935,21 +3935,6 @@
 }
 
 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)
 {
 	struct dhcp6_state *state;
--- a/src/dhcp6.h	Sat May 04 14:29:28 2019 +0100
+++ b/src/dhcp6.h	Wed Jun 12 13:43:27 2019 +0100
@@ -235,7 +235,6 @@
 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 */
 
--- a/src/ipv6nd.c	Sat May 04 14:29:28 2019 +0100
+++ b/src/ipv6nd.c	Wed Jun 12 13:43:27 2019 +0100
@@ -382,9 +382,6 @@
 	else {
 		logwarnx("%s: no IPv6 Routers available", ifp->name);
 		ipv6nd_drop(ifp);
-#ifdef DHCP6
-		dhcp6_dropnondelegates(ifp);
-#endif
 	}
 }
 
@@ -1525,9 +1522,6 @@
 	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 @@
 		 * as well punt it. */
 		if (!valid && !validone)
 			ipv6nd_free_ra(rap);
-#ifdef DHCP6
-		else
-			anyvalid = true;
-#endif
 	}
 
 	if (timespecisset(&next))
@@ -1616,12 +1606,6 @@
 		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