X-Git-Url: https://git.decadent.org.uk/gitweb/?p=odhcp6c.git;a=blobdiff_plain;f=src%2Fdhcpv6.c;h=64c0cb44e90107b184590d6d265e03286c09c8c6;hp=ed6b8f868a67accdad22418e34cfc369204f5347;hb=007ae1a6ae8092878adccde1f610ea9dd86e5aad;hpb=eaf3a11cad8a5dd389d5f52cc76e424e0242074b diff --git a/src/dhcpv6.c b/src/dhcpv6.c index ed6b8f8..64c0cb4 100644 --- a/src/dhcpv6.c +++ b/src/dhcpv6.c @@ -350,14 +350,14 @@ static int64_t dhcpv6_rand_delay(int64_t time) { int random; odhcp6c_random(&random, sizeof(random)); - return (time * (random % 1000)) / 10000; + return (time * ((int64_t)random % 1000LL)) / 10000LL; } int dhcpv6_request(enum dhcpv6_msg type) { uint8_t buf[1536]; - uint32_t timeout = UINT32_MAX; + uint64_t timeout = UINT32_MAX; struct dhcpv6_retx *retx = &dhcpv6_retx[type]; if (retx->delay) { @@ -378,7 +378,7 @@ int dhcpv6_request(enum dhcpv6_msg type) if (timeout == 0) return -1; - syslog(LOG_NOTICE, "Sending %s (timeout %us)", retx->name, timeout); + syslog(LOG_NOTICE, "Sending %s (timeout %us)", retx->name, (unsigned)timeout); uint64_t start = odhcp6c_get_milli_time(), round_start = start, elapsed;