]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
If renew or rebind is not set, always use a default from the lowest pltime
authorRoy Marples <roy@marples.name>
Sun, 2 Oct 2016 15:07:21 +0000 (15:07 +0000)
committerRoy Marples <roy@marples.name>
Sun, 2 Oct 2016 15:07:21 +0000 (15:07 +0000)
even if the lease does not expire, as some IA/PD might expire.
Thanks to Guy Yur.

dhcp6.c

diff --git a/dhcp6.c b/dhcp6.c
index 6846f4148d836c984c017532882979b1ff75e547..1042939e8975d124921f9f31874e82683fedfc98 100644 (file)
--- a/dhcp6.c
+++ b/dhcp6.c
@@ -3130,18 +3130,10 @@ dhcp6_handledata(void *arg)
                                state->renew = state->rebind = 0;
                        }
                }
-               if (state->renew == 0) {
-                       if (state->expire == ND6_INFINITE_LIFETIME)
-                               state->renew = ND6_INFINITE_LIFETIME;
-                       else if (state->lowpl != ND6_INFINITE_LIFETIME)
-                               state->renew = (uint32_t)(state->lowpl * 0.5);
-               }
-               if (state->rebind == 0) {
-                       if (state->expire == ND6_INFINITE_LIFETIME)
-                               state->rebind = ND6_INFINITE_LIFETIME;
-                       else if (state->lowpl != ND6_INFINITE_LIFETIME)
-                               state->rebind = (uint32_t)(state->lowpl * 0.8);
-               }
+               if (state->renew == 0 && state->lowpl != ND6_INFINITE_LIFETIME)
+                       state->renew = (uint32_t)(state->lowpl * 0.5);
+               if (state->rebind == 0 && state->lowpl != ND6_INFINITE_LIFETIME)
+                       state->rebind = (uint32_t)(state->lowpl * 0.8);
                break;
        default:
                state->reason = "UNKNOWN6";