}
// Disable IAs if not used
- if (type != DHCPV6_MSG_SOLICIT) {
- iov[IOV_RECONF_ACCEPT].iov_len = 0;
- if (ia_na_len == 0)
- iov[IOV_HDR_IA_NA].iov_len = 0;
- }
+ if (type != DHCPV6_MSG_SOLICIT && ia_na_len == 0)
+ iov[IOV_HDR_IA_NA].iov_len = 0;
if (na_mode == IA_MODE_NONE)
iov[IOV_HDR_IA_NA].iov_len = 0;
- if (!(client_options & DHCPV6_ACCEPT_RECONFIGURE))
+ if ((type != DHCPV6_MSG_SOLICIT && type != DHCPV6_MSG_REQUEST) ||
+ !(client_options & DHCPV6_ACCEPT_RECONFIGURE))
iov[IOV_RECONF_ACCEPT].iov_len = 0;
if (!(client_options & DHCPV6_CLIENT_FQDN))
continue;
md5_ctx_t md5;
- uint8_t serverhash[16], secretbytes[16], hash[16];
+ uint8_t serverhash[16], secretbytes[64], hash[16];
memcpy(serverhash, r->key, sizeof(serverhash));
memset(r->key, 0, sizeof(r->key));
- memcpy(secretbytes, reconf_key, sizeof(secretbytes));
+
+ memset(secretbytes, 0, sizeof(secretbytes));
+ memcpy(secretbytes, reconf_key, sizeof(reconf_key));
for (size_t i = 0; i < sizeof(secretbytes); ++i)
secretbytes[i] ^= 0x36;