From: Steven Barth Date: Sun, 3 Feb 2013 17:19:30 +0000 (+0100) Subject: Fix timing issues X-Git-Tag: debian/1.1+git20160131-1~178 X-Git-Url: https://git.decadent.org.uk/gitweb/?p=odhcp6c.git;a=commitdiff_plain;h=66216b3e5a55be3cc78179155a8f0f2dca79d172 Fix timing issues --- diff --git a/src/dhcpv6.c b/src/dhcpv6.c index 4bca6e7..561cf83 100644 --- a/src/dhcpv6.c +++ b/src/dhcpv6.c @@ -44,7 +44,7 @@ static bool dhcpv6_response_is_valid(const void *buf, ssize_t len, const uint8_t transaction[3], enum dhcpv6_msg type); -static time_t dhcpv6_parse_ia(void *opt, void *end); +static uint32_t dhcpv6_parse_ia(void *opt, void *end); static reply_handler dhcpv6_handle_reply; static reply_handler dhcpv6_handle_advert; @@ -640,8 +640,8 @@ static int dhcpv6_handle_reply(enum dhcpv6_msg orig, if ((otype == DHCPV6_OPT_IA_PD || otype == DHCPV6_OPT_IA_NA) && olen > sizeof(struct dhcpv6_ia_hdr)) { struct dhcpv6_ia_hdr *ia_hdr = (void*)(&odata[-4]); - time_t l_t1 = ntohl(ia_hdr->t1); - time_t l_t2 = ntohl(ia_hdr->t2); + uint32_t l_t1 = ntohl(ia_hdr->t1); + uint32_t l_t2 = ntohl(ia_hdr->t2); // Test ID and T1-T2 validity if (ia_hdr->iaid != 1 || l_t2 < l_t1) @@ -663,7 +663,7 @@ static int dhcpv6_handle_reply(enum dhcpv6_msg orig, if (l_t2 > 0 && t2 > l_t2) t2 = l_t2; - time_t n = dhcpv6_parse_ia(&ia_hdr[1], odata + olen); + uint32_t n = dhcpv6_parse_ia(&ia_hdr[1], odata + olen); if (n < t1) t1 = n; @@ -713,7 +713,7 @@ static int dhcpv6_handle_reply(enum dhcpv6_msg orig, } -static time_t dhcpv6_parse_ia(void *opt, void *end) +static uint32_t dhcpv6_parse_ia(void *opt, void *end) { uint32_t timeout = UINT32_MAX; // Minimum timeout uint16_t otype, olen;