From dc6c70fd5f505cdd9edad00eedccdd2fb1f9380c Mon Sep 17 00:00:00 2001 From: Patrick Rohr Date: Tue, 24 Oct 2023 09:45:26 -0700 Subject: [PATCH] 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 --- .../android/net/module/util/structs/IaPrefixOption.java | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) 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 db40abf3b4..89ac79d55c 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 @@ 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; }