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
diff --git a/staticlibs/device/com/android/net/module/util/structs/IaPrefixOption.java b/staticlibs/device/com/android/net/module/util/structs/IaPrefixOption.java
index db40abf..89ac79d 100644
--- a/staticlibs/device/com/android/net/module/util/structs/IaPrefixOption.java
+++ b/staticlibs/device/com/android/net/module/util/structs/IaPrefixOption.java
@@ -88,8 +88,10 @@
/**
* 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 @@
+ " 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;
}