]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
DHCP6: Keep running regardless of RA state
authorRoy Marples <roy@marples.name>
Wed, 12 Jun 2019 12:43:27 +0000 (13:43 +0100)
committerRoy Marples <roy@marples.name>
Wed, 12 Jun 2019 18:46:36 +0000 (19:46 +0100)
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.

src/dhcp6.c
src/dhcp6.h
src/ipv6nd.c

index 7f26129f6d4988c7b31fd570e3f8165701990bb6..e977e4755883f42e06361349dfe03ffe0618e6e0 100644 (file)
@@ -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)
 {
index a670566d292b2aef85200820ddf4a6dbf5fb7f7b..8853d7f8a2d6dbc111967841024bc56d0e3d8821 100644 (file)
@@ -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 */
 
index b5e503ccdbc4e023c49e4eb1ea27f2d55b055df9..947257adb1adb252622c96ba10046e6db68811b3 100644 (file)
@@ -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