- if (opt) {
- have_update |= odhcp6c_commit_state(STATE_DNS, dns_len);
- have_update |= odhcp6c_commit_state(STATE_SEARCH, search_len);
- have_update |= odhcp6c_commit_state(STATE_SNTP_IP,
- sntp_ip_len);
- have_update |= odhcp6c_commit_state(STATE_SNTP_FQDN,
- sntp_dns_len);
- have_update |= odhcp6c_commit_state(STATE_SIP_IP, sip_ip_len);
- have_update |= odhcp6c_commit_state(STATE_SIP_FQDN, sip_fqdn_len);
- size_t new_ia_pd_len, new_ia_na_len;
- odhcp6c_get_state(STATE_IA_PD, &new_ia_pd_len);
- odhcp6c_get_state(STATE_IA_NA, &new_ia_na_len);
- have_update |= (new_ia_pd_len != ia_pd_len) ||
- (new_ia_na_len != ia_na_len);
- }
-
- // Delete prefixes with 0 valid-time
- ia_pd = odhcp6c_get_state(STATE_IA_PD, &ia_pd_len);
- ia_end = ia_pd + ia_pd_len;
- dhcpv6_for_each_option(ia_pd, ia_end, otype, olen, odata) {
- struct dhcpv6_ia_prefix *p = (void*)&odata[-4];
- while (!p->valid) {
- ia_end = ia_pd + odhcp6c_remove_state(STATE_IA_PD,
- (uint8_t*)p - ia_pd, olen + 4);
- have_update = true;
- }
- }
-
-
- // Delete addresses with 0 valid-time
- ia_na = odhcp6c_get_state(STATE_IA_NA, &ia_na_len);
- ia_end = ia_na + ia_na_len;
- dhcpv6_for_each_option(ia_na, ia_end, otype, olen, odata) {
- struct dhcpv6_ia_addr *p = (void*)&odata[-4];
- while (!p->valid) {
- ia_end = ia_na + odhcp6c_remove_state(STATE_IA_NA,
- (uint8_t*)p - ia_na, olen + 4);
- have_update = true;
- }
- }
-
- return have_update;