summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans Dedecker2020-12-03 20:28:41 +0000
committerHans Dedecker2020-12-03 21:21:47 +0000
commitfaed29aa733cd3e7c0269d5dc2fc6a8e1d35f1ce (patch)
tree88b18c25de3681934a351f11bc1718bf526e50e2
parent9c50975bbba971b63d877b70c537bef1d2e81325 (diff)
downloadodhcp6c-faed29aa733cd3e7c0269d5dc2fc6a8e1d35f1ce.tar.gz
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 <dedeckeh@gmail.com>
-rw-r--r--src/dhcpv6.c7
1 files 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