]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
DHCP6: Mark everything excpept delegated addresses as stale
authorRoy Marples <roy@marples.name>
Fri, 30 Aug 2024 08:37:36 +0000 (09:37 +0100)
committerRoy Marples <roy@marples.name>
Fri, 30 Aug 2024 08:37:36 +0000 (09:37 +0100)
When parsing a lease.
A Prefix Delegation is part of a lease and should follow the same
rules for being stale as an address.

src/dhcp6.c

index 6b896bf26bd197362e6de3d4c991a1db66bcbc48..3c7f156ecf93d31bd8637eae4a14d9375c6fc7cd 100644 (file)
@@ -2373,7 +2373,9 @@ dhcp6_findia(struct interface *ifp, struct dhcp6_message *m, size_t l,
        i = e = 0;
        state = D6_STATE(ifp);
        TAILQ_FOREACH(ap, &state->addrs, next) {
-               if (!(ap->flags & (IPV6_AF_DELEGATED | IPV6_AF_DELEGATEDPFX)))
+               /* Anything not from a lease for this interface should be
+                * marked as stale. */
+               if (!(ap->flags & IPV6_AF_DELEGATED))
                        ap->flags |= IPV6_AF_STALE;
        }
 
@@ -2710,7 +2712,7 @@ out:
        return bytes;
 
 ex:
-       dhcp6_freedrop_addrs(ifp, 0, IPV6_AF_ANYDELEGATED, NULL);
+       dhcp6_freedrop_addrs(ifp, 0, IPV6_AF_DELEGATED, NULL);
        dhcp_unlink(ifp->ctx, state->leasefile);
        free(state->new);
        state->new = NULL;