From 60d340d5bb7e7d94d2d28897dd6dd824f831c445 Mon Sep 17 00:00:00 2001 From: Steven Barth Date: Fri, 11 Oct 2013 09:33:00 +0200 Subject: [PATCH] Don't hang indefinitely if REQUEST is never answered --- src/dhcpv6.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/dhcpv6.c b/src/dhcpv6.c index 0285923..f8a0385 100644 --- a/src/dhcpv6.c +++ b/src/dhcpv6.c @@ -62,7 +62,7 @@ static struct dhcpv6_retx dhcpv6_retx[_DHCPV6_MSG_MAX] = { dhcpv6_handle_reconfigure, NULL}, [DHCPV6_MSG_SOLICIT] = {true, 1, 3600, "SOLICIT", dhcpv6_handle_advert, dhcpv6_commit_advert}, - [DHCPV6_MSG_REQUEST] = {true, 30, 10, "REQUEST", + [DHCPV6_MSG_REQUEST] = {true, 1, 30, "REQUEST", dhcpv6_handle_reply, NULL}, [DHCPV6_MSG_RENEW] = {false, 10, 600, "RENEW", dhcpv6_handle_reply, NULL}, @@ -369,7 +369,9 @@ int dhcpv6_request(enum dhcpv6_msg type) nanosleep(&ts, NULL); } - if (type == DHCPV6_MSG_RELEASE || type == DHCPV6_MSG_DECLINE) + if (type == DHCPV6_MSG_REQUEST) + timeout = 60; + else if (type == DHCPV6_MSG_RELEASE || type == DHCPV6_MSG_DECLINE) timeout = 3; else if (type == DHCPV6_MSG_UNKNOWN) timeout = t1; -- 2.30.2