]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
DHCP6: Fix Prefix Delegation pltime and vltime
authorRoy Marples <roy@marples.name>
Thu, 29 Aug 2024 10:13:41 +0000 (11:13 +0100)
committerRoy Marples <roy@marples.name>
Thu, 29 Aug 2024 10:13:55 +0000 (11:13 +0100)
While here fix deleting non exteneded deprecated addresses

src/dhcp6.c

index 12bb8d1988da25e3feece3b3d01c357b6dcb40e9..6b896bf26bd197362e6de3d4c991a1db66bcbc48 100644 (file)
@@ -2251,8 +2251,8 @@ dhcp6_findpd(struct interface *ifp, const uint8_t *iaid,
                memcpy(&pdp_plen, o, sizeof(pdp_plen));
                o += sizeof(pdp_plen);
 
-               pdp_pltime = (uint16_t)ntohl(pdp_pltime);
-               pdp_vltime = (uint16_t)ntohl(pdp_vltime);
+               pdp_pltime = ntohl(pdp_pltime);
+               pdp_vltime = ntohl(pdp_vltime);
                /* RFC 3315 22.6 */
                if (pdp_pltime > pdp_vltime) {
                        errno = EINVAL;
@@ -2561,7 +2561,7 @@ dhcp6_deprecateaddrs(struct ipv6_addrhead *addrs)
                        continue;
                }
                TAILQ_REMOVE(addrs, ia, next);
-               if (ia->flags & IPV6_AF_EXTENDED)
+               if (!(ia->flags & IPV6_AF_EXTENDED))
                        ipv6_deleteaddr(ia);
                ipv6_freeaddr(ia);
        }