while (do_signal != SIGTERM) { // Main logic
odhcp6c_clear_state(STATE_SERVER_ID);
- odhcp6c_clear_state(STATE_SERVER_CAND);
+ odhcp6c_clear_state(STATE_IA_NA);
odhcp6c_clear_state(STATE_IA_PD);
odhcp6c_clear_state(STATE_SNTP_IP);
odhcp6c_clear_state(STATE_SNTP_FQDN);
dhcpv6_set_ia_na_mode(ia_na_mode);
bound = false;
+ // Server candidates need deep-delete
+ size_t cand_len;
+ struct dhcpv6_server_cand *cand = odhcp6c_get_state(STATE_SERVER_CAND, &cand_len);
+ for (size_t i = 0; i < cand_len / sizeof(*cand); ++i) {
+ free(cand[i].ia_na);
+ free(cand[i].ia_pd);
+ }
+ odhcp6c_clear_state(STATE_SERVER_CAND);
+
syslog(LOG_NOTICE, "(re)starting transaction on %s", ifname);
do_signal = 0;
{
if (do_signal == SIGIO) {
do_signal = 0;
- bool ra_rtnled = ra_rtnl_process();
bool ra_updated = ra_process();
- if (ra_rtnled || (ra_updated && (bound || allow_slaac_only == 0)))
+ if (ra_updated && (bound || allow_slaac_only == 0))
script_call("ra-updated"); // Immediate process urgent events
else if (ra_updated && !bound && allow_slaac_only > 0)
script_delay_call("ra-updated", allow_slaac_only);
}
+void* odhcp6c_move_state(enum odhcp6c_state state, size_t *len)
+{
+ *len = state_len[state];
+ void *data = state_data[state];
+
+ state_len[state] = 0;
+ state_data[state] = NULL;
+
+ return data;
+}
+
+
void* odhcp6c_get_state(enum odhcp6c_state state, size_t *len)
{
*len = state_len[state];
if (x) {
x->valid = new->valid;
x->preferred = new->preferred;
- x->prefix_class = new->prefix_class;
+ x->class = new->class;
} else {
odhcp6c_add_state(state, new, sizeof(*new));
}