dhcpv6: rebind capability support in reconfigure message (rfc6644)
authorHans Dedecker <dedeckeh@gmail.com>
Wed, 22 Mar 2017 13:14:26 +0000 (14:14 +0100)
committerHans Dedecker <dedeckeh@gmail.com>
Wed, 22 Mar 2017 13:19:52 +0000 (14:19 +0100)
Allow rebind message type to appear in reconfigure message option of
a reconfigure message as desccribed in rfc6644

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

index 6dc227fe6f37f77895f21473e4059fbb85bac39d..58050dc45b236c2d1446289bf6c3fe5af3da7cb8 100644 (file)
@@ -778,7 +778,7 @@ static bool dhcpv6_response_is_valid(const void *buf, ssize_t len,
                return false;
 
        if (rep->msg_type == DHCPV6_MSG_RECONF) {
-               if ((rcmsg != DHCPV6_MSG_RENEW && rcmsg != DHCPV6_MSG_INFO_REQ) ||
+               if ((rcmsg != DHCPV6_MSG_RENEW && rcmsg != DHCPV6_MSG_REBIND && rcmsg != DHCPV6_MSG_INFO_REQ) ||
                        (rcmsg == DHCPV6_MSG_INFO_REQ && ia_present) ||
                        !rcauth_ok || IN6_IS_ADDR_MULTICAST(daddr))
                        return false;
@@ -807,6 +807,10 @@ static int dhcpv6_handle_reconfigure(enum dhcpv6_msg orig, const int rc,
        dhcpv6_for_each_option(opt, end, otype, olen, odata) {
                if (otype == DHCPV6_OPT_RECONF_MESSAGE && olen == 1) {
                        switch (odata[0]) {
+                       case DHCPV6_MSG_REBIND:
+                               if (t2 != UINT32_MAX)
+                                       t2 = 0;
+                       // Fall through
                        case DHCPV6_MSG_RENEW:
                                if (t1 != UINT32_MAX)
                                        t1 = 0;