Follow-up fix for
bc9d317f2921 ("dhcpv6-ia: fix invalid preferred
lifetime").
https://www.rfc-editor.org/rfc/rfc4861#page-44
Fixes: bc9d317f2921 ("dhcpv6-ia: fix invalid preferred lifetime")
Signed-off-by: Paul Donald <newtwen@gmail.com>
Reviewed-by: Daniel Golle <daniel@makrotopia.org>
[ fix comment format and improve commit title ]
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
valid_lt = iface->dhcp_leasetime;
}
+ if (preferred_lt > valid_lt) {
+ /*
+ * RFC4861 ยง 6.2.1
+ * This value [AdvPreferredLifetime] MUST NOT be larger than
+ * AdvValidLifetime.
+ */
+ preferred_lt = valid_lt;
+ }
+
if (minvalid > valid_lt)
minvalid = valid_lt;