dhcpv6: don't return renew msg in case of invalid msg type in reconfigure msg
authorHans Dedecker <dedeckeh@gmail.com>
Sat, 18 Mar 2017 17:00:03 +0000 (18:00 +0100)
committerHans Dedecker <dedeckeh@gmail.com>
Sat, 18 Mar 2017 18:01:59 +0000 (19:01 +0100)
Return -1 in case the msg type in the reconfigure message is invalid and
as such don't start sending renew messages.

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
src/dhcpv6.c

index 71e1cc248a8bc966a34c111b22595b505ec62aec..17b515083dbaec9635c4e8657e9b0f53e9f0a3db 100644 (file)
@@ -801,7 +801,8 @@ static int dhcpv6_handle_reconfigure(_unused enum dhcpv6_msg orig, const int rc,
                const void *opt, const void *end, _unused const struct sockaddr_in6 *from)
 {
        uint16_t otype, olen;
-       uint8_t *odata, msg = DHCPV6_MSG_RENEW;
+       uint8_t *odata;
+       int msg = -1;
 
        dhcpv6_for_each_option(opt, end, otype, olen, odata) {
                if (otype == DHCPV6_OPT_RECONF_MESSAGE && olen == 1 && (