From c09c3a329536fb3117be282f7b4686bf872a7d83 Mon Sep 17 00:00:00 2001 From: Steven Barth Date: Fri, 8 Mar 2013 08:53:13 +0100 Subject: [PATCH] Fix timing issues with large T1 and T2 values --- src/dhcpv6.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/dhcpv6.c b/src/dhcpv6.c index 8be70af..da920ce 100644 --- a/src/dhcpv6.c +++ b/src/dhcpv6.c @@ -623,7 +623,7 @@ static int dhcpv6_handle_reply(enum dhcpv6_msg orig, if (t3 < 0) t3 = 0; } else { - t1 = t2 = t3 = 86400; + t1 = t2 = t3 = UINT32_MAX; } if (opt) { @@ -674,6 +674,12 @@ static int dhcpv6_handle_reply(enum dhcpv6_msg orig, if (n < t3) t3 = n; + if (t2 >= t3) + t2 = 8 * t3 / 10; + + if (t1 >= t2) + t1 = 5 * t2 / 8; + } else if (otype == DHCPV6_OPT_DNS_SERVERS) { if (olen % 16 == 0) odhcp6c_add_state(STATE_DNS, odata, olen); -- 2.30.2