config_parse_iaid(), dhcp_identifier_set_iaid() and sd_dhcp6_client_set_iaid() all
allow for the IAID to be zero. Also, RFC 3315 makes no mention that zero
would be invalid.
However, client_ensure_iaid() would take an IAID of zero as a sign that
the values was unset. Fix that by keeping track whether IAID is
initialized.
struct sd_dhcp6_lease *lease;
int fd;
bool information_request;
+ bool has_iaid;
be16_t *req_opts;
size_t req_opts_allocated;
size_t req_opts_len;
client->ia_na.ia_na.id = htobe32(iaid);
client->ia_pd.ia_pd.id = htobe32(iaid);
+ client->has_iaid = true;
return 0;
}
assert(client);
- if (client->ia_na.ia_na.id)
+ if (client->has_iaid)
return 0;
r = dhcp_identifier_set_iaid(client->ifindex, client->mac_addr, client->mac_addr_len, true, &iaid);
client->ia_na.ia_na.id = iaid;
client->ia_pd.ia_pd.id = iaid;
+ client->has_iaid = true;
return 0;
}