summaryrefslogtreecommitdiff
path: root/src/dhcpv6.c
diff options
context:
space:
mode:
authorSteven Barth <steven@midlink.org>2014-11-28 01:29:59 +0100
committerSteven Barth <steven@midlink.org>2014-11-28 01:29:59 +0100
commit2e955b5ab5560302ab4f7a8372e4132d5a14a001 (patch)
tree5dde9c944be6f618e979fd3f1ef678aee2258c96 /src/dhcpv6.c
parent7e6eebbe7d3df2b86b36b2e0d6ae7ee65f642094 (diff)
downloadodhcp6c-2e955b5ab5560302ab4f7a8372e4132d5a14a001.tar.gz
Fix initial delay of SOLICIT message
Signed-off-by: Steven Barth <steven@midlink.org>
Diffstat (limited to 'src/dhcpv6.c')
-rw-r--r--src/dhcpv6.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/dhcpv6.c b/src/dhcpv6.c
index 1af5c9a..e857823 100644
--- a/src/dhcpv6.c
+++ b/src/dhcpv6.c
@@ -487,8 +487,8 @@ int dhcpv6_request(enum dhcpv6_msg type)
if (retx->delay) {
struct timespec ts = {0, 0};
- ts.tv_nsec = dhcpv6_rand_delay(10 * DHCPV6_REQ_DELAY);
- nanosleep(&ts, NULL);
+ ts.tv_nsec = (dhcpv6_rand_delay((10000 * DHCPV6_REQ_DELAY) / 2) + (1000 * DHCPV6_REQ_DELAY) / 2) * 1000000;
+ while (nanosleep(&ts, &ts) < 0 && errno == EINTR);
}
if (type == DHCPV6_MSG_UNKNOWN)