Add status code ok option in reply to a decline message
[project/odhcpd.git] / src / dhcpv6-ia.c
index 5e34b5c..c655d93 100644 (file)
@@ -1191,7 +1191,8 @@ ssize_t dhcpv6_handle_ia(uint8_t *buf, size_t buflen, struct interface *iface,
                response_len += ia_response_len;
        }
 
-       if (hdr->msg_type == DHCPV6_MSG_RELEASE && response_len + 6 < buflen) {
+       if ((hdr->msg_type == DHCPV6_MSG_RELEASE  || hdr->msg_type == DHCPV6_MSG_DECLINE) &&
+                       response_len + 6 < buflen) {
                buf[0] = 0;
                buf[1] = DHCPV6_OPT_STATUS;
                buf[2] = 0;