Remove check that preferred lifetime >= t2

For a single address, DHCPv6 won't work well (i.e. potentially lose provisioning) if
the preferred lifetime is lower than t2. However, this might be a valid
scenario in a renumbering event in the presence of multiple prefixes.

Additionally, in DHCPv6 it is up to the server to configure the client
correctly.

Test: TH
Change-Id: I37b2a0b89deda85b3f7be29c8f02f685aa6e65f8
This commit is contained in:
Patrick Rohr
2023-10-24 09:45:26 -07:00
parent b8af9d5c19
commit dc6c70fd5f

View File

@@ -88,8 +88,10 @@ public class IaPrefixOption extends Struct {
/**
* Check whether or not IA Prefix option in IA_PD option is valid per RFC8415#section-21.22.
*
* Note: an expired prefix can still be valid.
*/
public boolean isValid(int t2) {
public boolean isValid() {
if (preferred < 0 || valid < 0) {
Log.w(TAG, "IA_PD option with invalid lifetime, preferred lifetime " + preferred
+ ", valid lifetime " + valid);
@@ -105,11 +107,6 @@ public class IaPrefixOption extends Struct {
+ " longer than 64");
return false;
}
// Either preferred lifetime or t2 might be 0 which is valid, then ignore it.
if (preferred != 0 && t2 != 0 && preferred < t2) {
Log.w(TAG, "preferred lifetime " + preferred + " is smaller than T2 " + t2);
return false;
}
return true;
}