m = i;
for (size_t i = 0; i < addrlen; ++i) {
- uint32_t prefix_pref = addrs[i].preferred - now;
- uint32_t prefix_valid = addrs[i].valid - now;
+ uint32_t prefix_pref = addrs[i].preferred;
+ uint32_t prefix_valid = addrs[i].valid;
if (addrs[i].prefix > 96 ||
addrs[i].preferred <= (uint32_t)now)
continue;
+ if (prefix_pref != UINT32_MAX)
+ prefix_pref -= now;
+
+ if (prefix_valid != UINT32_MAX)
+ prefix_valid -= now;
+
if (a->length < 128) {
struct dhcpv6_ia_prefix p = {
.type = htons(DHCPV6_OPT_IA_PREFIX),