From: Steven Barth Date: Fri, 8 Mar 2013 07:53:13 +0000 (+0100) Subject: Fix timing issues with large T1 and T2 values X-Git-Tag: debian/1.1+git20160131-1~174 X-Git-Url: https://git.decadent.org.uk/gitweb/?a=commitdiff_plain;h=c09c3a329536fb3117be282f7b4686bf872a7d83;p=odhcp6c.git Fix timing issues with large T1 and T2 values --- 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);