/* Form a DHCPv6 lease structure based upon packet contents. Creates and
* populates IA's and any IAADDR/IAPREFIX's they contain.
+ * Parsed options are deleted in order to not save them in the lease file.
*/
static struct dhc6_lease *
dhc6_leaseify(struct packet *packet)
data_string_forget(&ds, MDL);
}
+ delete_option(&dhcpv6_universe, lease->options, D6O_PREFERENCE);
/* Dig into recursive DHCPv6 pockets for IA_NA and contained IAADDR
* options.
return ISC_R_UNEXPECTED;
}
}
+ delete_option(&dhcpv6_universe, options, D6O_IA_NA);
return ISC_R_SUCCESS;
}
return ISC_R_UNEXPECTED;
}
}
+ delete_option(&dhcpv6_universe, options, D6O_IA_TA);
return ISC_R_SUCCESS;
}
return ISC_R_UNEXPECTED;
}
}
+ delete_option(&dhcpv6_universe, options, D6O_IA_PD);
return ISC_R_SUCCESS;
}
return ISC_R_UNEXPECTED;
}
}
+ delete_option(&dhcpv6_universe, options, D6O_IAADDR);
return ISC_R_SUCCESS;
}
return ISC_R_UNEXPECTED;
}
}
+ delete_option(&dhcpv6_universe, options, D6O_IAPREFIX);
return ISC_R_SUCCESS;
}
struct timeval tv;
/* If there is no active lease, there is nothing to check. */
- if (client->active_lease == NULL) {
+ if ((client->active_lease == NULL) || client->active_lease->released) {
start_init6(client);
return;
}
*/
unconfigure6(client, "RELEASE6");
+ /* Note this in the lease file. */
+ if (client->active_lease == NULL)
+ return;
+ client->active_lease->released = ISC_TRUE;
+ write_client6_lease(client, client->active_lease, 0, 1);
+
/* Set timers per RFC3315 section 18.1.1. */
client->IRT = REL_TIMEOUT * 100;
client->MRT = 0;
"is selected.");
return;
}
+ lease->released = ISC_FALSE;
old = client->old_lease;
client->v6_handler = bound_handler;
/* If we have a previous binding, Confirm
* that we can (or can't) still use it.
*/
- if (client->active_lease != NULL)
+ if ((client->active_lease != NULL) &&
+ !client->active_lease->released)
start_confirm6(client);
else
start_init6(client);
return ISC_R_IOERROR;
}
+ if (lease->released) {
+ stat = fprintf(leaseFile, " released;\n");
+ if (stat <= 0)
+ return ISC_R_IOERROR;
+ }
+
if (lease->options != NULL)
write_options(client, lease->options, " ");