From: Roy Marples Date: Thu, 29 Aug 2024 10:13:41 +0000 (+0100) Subject: DHCP6: Fix Prefix Delegation pltime and vltime X-Git-Tag: v10.1.0~20 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6cb9e8b74f033afdf1b4f29cd5b9943268a32a60;p=thirdparty%2Fdhcpcd.git DHCP6: Fix Prefix Delegation pltime and vltime While here fix deleting non exteneded deprecated addresses --- diff --git a/src/dhcp6.c b/src/dhcp6.c index 12bb8d19..6b896bf2 100644 --- a/src/dhcp6.c +++ b/src/dhcp6.c @@ -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); }