From 53767fc0318e1320afa509946ca7dbeb0a89411f Mon Sep 17 00:00:00 2001 From: Hans Dedecker Date: Wed, 22 Mar 2017 13:58:04 +0100 Subject: [PATCH] dhcpv6: respect renew end point when handling reconfigure message Set T1 to 0 when receiving reconfigure message with as msg type renew; this keeps the renew end point fixed meaning rebinding is started at T2 as initially calculated. Signed-off-by: Hans Dedecker --- src/dhcpv6.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/src/dhcpv6.c b/src/dhcpv6.c index d63d551..6dc227f 100644 --- a/src/dhcpv6.c +++ b/src/dhcpv6.c @@ -805,10 +805,20 @@ static int dhcpv6_handle_reconfigure(enum dhcpv6_msg orig, const int rc, int msg = -1; dhcpv6_for_each_option(opt, end, otype, olen, odata) { - if (otype == DHCPV6_OPT_RECONF_MESSAGE && olen == 1 && ( - odata[0] == DHCPV6_MSG_RENEW || - odata[0] == DHCPV6_MSG_INFO_REQ)) - msg = odata[0]; + if (otype == DHCPV6_OPT_RECONF_MESSAGE && olen == 1) { + switch (odata[0]) { + case DHCPV6_MSG_RENEW: + if (t1 != UINT32_MAX) + t1 = 0; + // Fall through + case DHCPV6_MSG_INFO_REQ: + msg = odata[0]; + break; + + default: + break; + } + } } dhcpv6_handle_reply(orig, rc, NULL, NULL, NULL); -- 2.25.1