- // If we have any IAs, send renew, otherwise request
- int r;
- if (ia_pd_len == 0 && ia_na_len == 0)
- r = dhcpv6_request(DHCPV6_MSG_REQUEST);
- else
- r = dhcpv6_request(DHCPV6_MSG_RENEW);
- odhcp6c_signal_process();
- if (r > 0) // Publish updates
- script_call("updated");
- if (r >= 0)
- continue; // Renew was successful
-
- odhcp6c_clear_state(STATE_SERVER_ID); // Remove binding
-
- // If we have IAs, try rebind otherwise restart
- res = dhcpv6_request(DHCPV6_MSG_REBIND);
- odhcp6c_signal_process();
-
- odhcp6c_get_state(STATE_IA_PD, &ia_pd_new);
- odhcp6c_get_state(STATE_IA_NA, &ia_na_new);
- if (res < 0 || (ia_pd_new == 0 && ia_pd_len) ||
- (ia_na_new == 0 && ia_na_len))
- break; // We lost all our IAs, restart
- else if (res > 0)
- script_call("rebound");
- }
+ // If we have IAs, try rebind otherwise restart
+ res = dhcpv6_request(DHCPV6_MSG_REBIND);
+ odhcp6c_signal_process();