From faed29aa733cd3e7c0269d5dc2fc6a8e1d35f1ce Mon Sep 17 00:00:00 2001 From: Hans Dedecker Date: Thu, 3 Dec 2020 21:28:41 +0100 Subject: [PATCH] dhcpv6: only refresh timers when reconfigure is valid Refresh timers only when a valid DHCPv6 msg-type has been received in the received DHCPv6 reconfigure Signed-off-by: Hans Dedecker --- src/dhcpv6.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/dhcpv6.c b/src/dhcpv6.c index 370c9ea..11cc8b6 100644 --- a/src/dhcpv6.c +++ b/src/dhcpv6.c @@ -840,7 +840,7 @@ static int dhcpv6_handle_reconfigure(enum dhcpv6_msg orig, const int rc, { uint16_t otype, olen; uint8_t *odata; - int msg = -1; + enum dhcpv6_msg msg = DHCPV6_MSG_UNKNOWN; dhcpv6_for_each_option(opt, end, otype, olen, odata) { if (otype == DHCPV6_OPT_RECONF_MESSAGE && olen == 1) { @@ -866,9 +866,10 @@ static int dhcpv6_handle_reconfigure(enum dhcpv6_msg orig, const int rc, } } - dhcpv6_handle_reply(orig, rc, NULL, NULL, NULL); + if (msg != DHCPV6_MSG_UNKNOWN) + dhcpv6_handle_reply(orig, rc, NULL, NULL, NULL); - return msg; + return (msg == DHCPV6_MSG_UNKNOWN? -1: 1); } // Collect all advertised servers -- 2.30.2