2
0
mirror of https://gitlab.isc.org/isc-projects/dhcp synced 2025-08-22 18:07:25 +00:00

*** empty log message ***

This commit is contained in:
David Hankins 2009-09-11 18:13:12 +00:00
parent 875e99dc30
commit 5a671e8715
5 changed files with 52 additions and 54 deletions

View File

@ -66,6 +66,11 @@ work on other platforms. Please report any problems and suggested fixes to
scope, or having a DHCP client send any system hostname in the host-name or scope, or having a DHCP client send any system hostname in the host-name or
FQDN options by default). FQDN options by default).
- The dhcp-renewal-time and dhcp-rebinding-time options may now be configured
for DHCPv4 operation and used independently of the dhcp-lease-time
calculations. Invalid renew and rebinding times (e.g., greater than the
determined lease time) are omitted.
Changes since 4.1.0 (bug fixes) Changes since 4.1.0 (bug fixes)
- Remove infinite loop in token_print_indent_concat(). - Remove infinite loop in token_print_indent_concat().

View File

@ -1,4 +1,4 @@
.\" $Id: dhcp-options.5,v 1.44 2009/07/23 18:52:19 sar Exp $ .\" $Id: dhcp-options.5,v 1.45 2009/09/11 18:13:12 dhankins Exp $
.\" .\"
.\" Copyright (c) 2004-2008 by Internet Systems Consortium, Inc. ("ISC") .\" Copyright (c) 2004-2008 by Internet Systems Consortium, Inc. ("ISC")
.\" Copyright (c) 1996-2003 by Internet Software Consortium .\" Copyright (c) 1996-2003 by Internet Software Consortium
@ -364,7 +364,11 @@ return.
This option specifies the number of seconds from the time a client gets This option specifies the number of seconds from the time a client gets
an address until the client transitions to the REBINDING state. an address until the client transitions to the REBINDING state.
.PP .PP
This option is not user configurable. This option is user configurable, but it will be ignored if the value is
greater than the lease time.
.PP
To make DHCPv4+DHCPv6 migration easier in the future, any value configured
in this option is also used as a DHCPv6 "T1" (renew) time.
.PP .PP
.RE .RE
.PP .PP
@ -374,7 +378,11 @@ This option is not user configurable.
This option specifies the number of seconds from the time a client gets This option specifies the number of seconds from the time a client gets
an address until the client transitions to the RENEWING state. an address until the client transitions to the RENEWING state.
.PP .PP
This option is not user configurable. This option is user configurable, but it will be ignored if the value is
greater than the rebinding time, or lease time.
.PP
To make DHCPv4+DHCPv6 migration easier in the future, any value configured
in this option is also used as a DHCPv6 "T2" (rebind) time.
.PP .PP
.RE .RE
.PP .PP

View File

@ -642,6 +642,8 @@ cons_options(struct packet *inpacket, struct dhcp_packet *outpacket,
priority_list[priority_len++] = DHO_DHCP_MESSAGE_TYPE; priority_list[priority_len++] = DHO_DHCP_MESSAGE_TYPE;
priority_list[priority_len++] = DHO_DHCP_SERVER_IDENTIFIER; priority_list[priority_len++] = DHO_DHCP_SERVER_IDENTIFIER;
priority_list[priority_len++] = DHO_DHCP_LEASE_TIME; priority_list[priority_len++] = DHO_DHCP_LEASE_TIME;
priority_list[priority_len++] = DHO_DHCP_RENEWAL_TIME;
priority_list[priority_len++] = DHO_DHCP_REBINDING_TIME;
priority_list[priority_len++] = DHO_DHCP_MESSAGE; priority_list[priority_len++] = DHO_DHCP_MESSAGE;
priority_list[priority_len++] = DHO_DHCP_REQUESTED_ADDRESS; priority_list[priority_len++] = DHO_DHCP_REQUESTED_ADDRESS;
priority_list[priority_len++] = DHO_ASSOCIATED_IP; priority_list[priority_len++] = DHO_ASSOCIATED_IP;
@ -656,6 +658,10 @@ cons_options(struct packet *inpacket, struct dhcp_packet *outpacket,
data_string_truncate(prl, (PRIORITY_COUNT - priority_len)); data_string_truncate(prl, (PRIORITY_COUNT - priority_len));
/*
* Copy the client's PRL onto the priority_list after our high
* priority header.
*/
for (i = 0; i < prl->len; i++) { for (i = 0; i < prl->len; i++) {
/* /*
* Prevent client from changing order of delivery * Prevent client from changing order of delivery

View File

@ -754,26 +754,6 @@ int parse_statement (cfile, group, type, host_decl, declaration)
return declaration; return declaration;
} }
/*
* If the configuration attempts to define on option
* that we ignore, then warn about it now.
*
* In DHCPv4 we do not use dhcp-renewal-time or
* dhcp-rebinding-time, but we use these in DHCPv6.
*
* XXX: We may want to include a "blacklist" of
* options we ignore in the future, as a table.
*/
if ((option->code == DHO_DHCP_LEASE_TIME) ||
((local_family != AF_INET6) &&
((option->code == DHO_DHCP_RENEWAL_TIME) ||
(option->code == DHO_DHCP_REBINDING_TIME))))
{
log_error("WARNING: server ignoring option %s "
"in configuration file.",
option->name);
}
finish_option: finish_option:
et = (struct executable_statement *)0; et = (struct executable_statement *)0;
if (!parse_option_statement if (!parse_option_statement

View File

@ -2546,39 +2546,38 @@ void ack_lease (packet, lease, offer, when, msg, ms_nulltp, hp)
option_cache_dereference (&oc, MDL); option_cache_dereference (&oc, MDL);
} }
/* Renewal time is lease time * 0.5. */ /*
offered_lease_time /= 2; * Validate any configured renew or rebinding times against
putULong(state->renewal, (u_int32_t)offered_lease_time); * the determined lease time. Do rebinding first so that
i = DHO_DHCP_RENEWAL_TIME; * the renew time can be validated against the rebind time.
oc = (struct option_cache *)0; */
if (option_cache_allocate (&oc, MDL)) { if ((oc = lookup_option(&dhcp_universe, state->options,
if (make_const_data(&oc->expression, state->renewal, DHO_DHCP_REBINDING_TIME)) != NULL &&
4, 0, 0, MDL)) { evaluate_option_cache(&d1, packet, lease, NULL,
option_code_hash_lookup(&oc->option, packet->options, state->options,
dhcp_universe.code_hash, &lease->scope, oc, MDL)) {
&i, 0, MDL); TIME rebind_time = getULong(d1.data);
save_option (&dhcp_universe,
state -> options, oc); /* Drop the configured (invalid) rebinding time. */
} if (rebind_time >= offered_lease_time)
option_cache_dereference (&oc, MDL); delete_option(&dhcp_universe, state->options,
DHO_DHCP_REBINDING_TIME);
else /* XXX: variable is reused. */
offered_lease_time = rebind_time;
data_string_forget(&d1, MDL);
} }
/* Rebinding time is lease time * 0.875. */ if ((oc = lookup_option(&dhcp_universe, state->options,
offered_lease_time += (offered_lease_time / 2 DHO_DHCP_RENEWAL_TIME)) != NULL &&
+ offered_lease_time / 4); evaluate_option_cache(&d1, packet, lease, NULL,
putULong(state->rebind, (u_int32_t)offered_lease_time); packet->options, state->options,
i = DHO_DHCP_REBINDING_TIME; &lease->scope, oc, MDL)) {
oc = (struct option_cache *)0; if (getULong(d1.data) >= offered_lease_time)
if (option_cache_allocate (&oc, MDL)) { delete_option(&dhcp_universe, state->options,
if (make_const_data(&oc->expression, state->rebind, DHO_DHCP_RENEWAL_TIME);
4, 0, 0, MDL)) {
option_code_hash_lookup(&oc->option, data_string_forget(&d1, MDL);
dhcp_universe.code_hash,
&i, 0, MDL);
save_option (&dhcp_universe,
state -> options, oc);
}
option_cache_dereference (&oc, MDL);
} }
} else { } else {
/* XXXSK: should we use get_server_source_address() here? */ /* XXXSK: should we use get_server_source_address() here? */