if ((file = open (path_dhclient_db, O_RDONLY)) < 0)
return;
cfile = (struct parse *)0;
- new_parse (&cfile, file, (char *)0, 0, path_dhclient_db, 0);
+ /* new_parse() may fail if the file is of zero length. */
+ if (new_parse(&cfile, file, (char *)0, 0,
+ path_dhclient_db, 0) != ISC_R_SUCCESS)
+ return;
do {
token = next_token (&val, (unsigned *)0, cfile);
memset(&cid, 0, sizeof(cid));
if (!lookup_option(&dhcpv6_universe, packet->options, D6O_SERVERID)) {
- log_error("Advertise without a server identifier received.");
+ log_error("Response without a server identifier received.");
rval = ISC_FALSE;
}
!evaluate_option_cache(&sid, packet, NULL, client, packet->options,
client->sent_options, &global_scope, oc,
MDL)) {
- log_error("Advertise without a client identifier.");
+ log_error("Response without a client identifier.");
rval = ISC_FALSE;
}
}
}
+ /* A Confirm->Reply is unsuitable for comparison to the old lease. */
+ if (client->state == S_REBOOTING)
+ return rval;
+
switch (client->state) {
case S_SELECTING:
/* Compare the new lease with the selected lease to make
option_cache_dereference(&oc, MDL);
}
+ /* Bring in any configured options to send. */
+ if (client->config->on_transmission)
+ execute_statements_in_scope(NULL, NULL, NULL, client,
+ lease ? lease->options : NULL,
+ *op, &global_scope,
+ client->config->on_transmission,
+ NULL);
+
/* See if the user configured a DUID in a relevant scope. If not,
* introduce our default manufactured id.
*/
* deprecated by adjustments to the 'request' syntax also used for
* DHCPv4.
*/
- if (lookup_option(&dhcpv6_universe, *op, D6O_ORO) == NULL)
+ if (lookup_option(&dhcpv6_universe, *op, D6O_ORO) != NULL)
log_error("'send dhcp6.oro' syntax is deprecated, please "
"use the 'request' syntax (\"man dhclient.conf\").");
data_string_forget(&oro, MDL);
- /* Bring in any configured options to send. */
- if (client->config->on_transmission)
- execute_statements_in_scope(NULL, NULL, NULL, client,
- lease ? lease->options : NULL,
- *op, &global_scope,
- client->config->on_transmission,
- NULL);
-
/* RFC3315 says we MUST inclue an ORO in Requests. If we have it
- * in the cache for one, we have it for both, so it's fatal either
- * way (may as well fail early).
+ * in the cache for Requests, we have it for Solicits, so it's fatal
+ * either way (may as well fail early on Solicits).
*/
if (lookup_option(&dhcpv6_universe, *op, D6O_ORO) == NULL)
log_fatal("Internal inconsistency: no dhcp6.oro in transmit "
/* Client and server DUIDs are opaque fields, but marking them
* up somewhat makes configuration easier.
*/
- { "client-id", "Nduid-types.X", &dhcpv6_universe, 1, 1 },
+ { "client-id", "X", &dhcpv6_universe, 1, 1 },
{ "server-id", "X", &dhcpv6_universe, 2, 1 },
/* ia-* options actually have at their ends a space for options