Commit 9ab0cc6a authored by David Hankins's avatar David Hankins
Browse files

Client bugs introduced in development repaired. [ISC-Bugs #17192]

parent c382bc98
......@@ -242,7 +242,10 @@ void read_client_leases ()
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);
......
......@@ -325,7 +325,7 @@ valid_reply(struct packet *packet, struct client_state *client)
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;
}
......@@ -334,7 +334,7 @@ valid_reply(struct packet *packet, struct client_state *client)
!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;
}
......@@ -1732,6 +1732,10 @@ dhc6_check_reply(struct client_state *client, struct dhc6_lease *new)
}
}
/* 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
......@@ -3178,6 +3182,14 @@ make_client6_options(struct client_state *client, struct option_state **op,
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.
*/
......@@ -3213,7 +3225,7 @@ make_client6_options(struct client_state *client, struct option_state **op,
* 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\").");
......@@ -3300,17 +3312,9 @@ make_client6_options(struct client_state *client, struct option_state **op,
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 "
......
......@@ -2511,7 +2511,7 @@ write_client6_lease(struct client_state *client, struct dhc6_lease *lease,
return ISC_R_IOERROR;
for (ia = lease->bindings ; ia != NULL ; ia = ia->next) {
stat = fprintf(leaseFile, " ia_na %s {\n",
stat = fprintf(leaseFile, " ia-na %s {\n",
print_hex_1(4, ia->iaid, 12));
if (stat <= 0)
return ISC_R_IOERROR;
......
......@@ -305,7 +305,7 @@ static struct option dhcpv6_options[] = {
/* 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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment