#ifndef lint
static char copyright[] =
-"$Id: bootp.c,v 1.58 2000/01/05 18:12:09 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium. All rights reserved.\n";
+"$Id: bootp.c,v 1.59 2000/01/25 01:32:41 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
/* Run the executable statements to compute the client and server
options. */
- option_state_allocate (&options, "bootrequest");
+ option_state_allocate (&options, MDL);
/* Execute the subnet statements. */
execute_statements_in_scope (packet, lease, packet -> options, options,
- lease -> subnet -> group,
+ &lease -> scope, lease -> subnet -> group,
(struct group *)0);
/* Execute statements from class scopes. */
for (i = packet -> class_count; i > 0; i--) {
execute_statements_in_scope
(packet, lease, packet -> options, options,
- packet -> classes [i - 1] -> group,
+ &lease -> scope, packet -> classes [i - 1] -> group,
lease -> subnet -> group);
}
/* Execute the host statements. */
execute_statements_in_scope (packet, lease, packet -> options, options,
+ &lease -> scope,
hp -> group, subnet -> group);
/* Drop the request if it's not allowed for this client. */
if ((oc = lookup_option (&server_universe, options, SV_ALLOW_BOOTP)) &&
!evaluate_boolean_option_cache (&ignorep, packet, lease,
- packet -> options, options, oc)) {
+ packet -> options, options,
+ &lease -> scope, oc, MDL)) {
if (!ignorep)
log_info ("%s: bootp disallowed", msgbuf);
- option_state_dereference (&options, "bootrequest");
- static_lease_dereference (lease, "bootrequest");
+ option_state_dereference (&options, MDL);
+ static_lease_dereference (lease, MDL);
return;
}
if ((oc = lookup_option (&server_universe,
options, SV_ALLOW_BOOTING)) &&
!evaluate_boolean_option_cache (&ignorep, packet, lease,
- packet -> options, options, oc)) {
+ packet -> options, options,
+ &lease -> scope, oc, MDL)) {
if (!ignorep)
log_info ("%s: booting disallowed", msgbuf);
- option_state_dereference (&options, "bootrequest");
- static_lease_dereference (lease, "bootrequest");
+ option_state_dereference (&options, MDL);
+ static_lease_dereference (lease, MDL);
return;
}
if (!packet -> options_valid &&
!(evaluate_boolean_option_cache
(&ignorep, packet, lease, packet -> options, options,
+ &lease -> scope,
lookup_option (&server_universe, options,
- SV_ALWAYS_REPLY_RFC1048)))) {
+ SV_ALWAYS_REPLY_RFC1048), MDL))) {
memcpy (outgoing.raw -> options,
packet -> raw -> options, DHCP_OPTION_LEN);
outgoing.packet_length = BOOTP_MIN_LEN;
oc = (struct option_cache *)0;
i = DHO_SUBNET_MASK;
if (!lookup_option (&dhcp_universe, options, i)) {
- if (option_cache_allocate (&oc, "ack_lease")) {
+ if (option_cache_allocate (&oc, MDL)) {
if (make_const_data
(&oc -> expression,
lease -> subnet -> netmask.iabuf,
save_option (&dhcp_universe,
options, oc);
}
- option_cache_dereference (&oc, "ack_lease");
+ option_cache_dereference (&oc, MDL);
}
}
outgoing.packet_length =
cons_options (packet, outgoing.raw, lease, 0,
packet -> options, options,
+ &lease -> scope,
0, 0, 1, (struct data_string *)0);
if (outgoing.packet_length < BOOTP_MIN_LEN)
outgoing.packet_length = BOOTP_MIN_LEN;
if ((oc = lookup_option (&server_universe,
options, SV_ALWAYS_BROADCAST)) &&
evaluate_boolean_option_cache (&ignorep, packet, lease,
- packet -> options, options, oc))
+ packet -> options, options,
+ &lease -> scope, oc, MDL))
raw.flags |= htons (BOOTP_BROADCAST);
/* Figure out the address of the next server. */
oc = lookup_option (&server_universe, options, SV_NEXT_SERVER);
if (oc &&
evaluate_option_cache (&d1, packet, lease,
- packet -> options, options, oc)) {
+ packet -> options, options,
+ &lease -> scope, oc, MDL)) {
/* If there was more than one answer, take the first. */
if (d1.len >= 4 && d1.data)
memcpy (&raw.siaddr, d1.data, 4);
- data_string_forget (&d1, "bootrequest");
+ data_string_forget (&d1, MDL);
} else {
if (lease -> subnet -> shared_network -> interface)
raw.siaddr = (lease -> subnet -> shared_network ->
oc = lookup_option (&server_universe, options, SV_FILENAME);
if (oc &&
evaluate_option_cache (&d1, packet, lease,
- packet -> options, options, oc)) {
+ packet -> options, options,
+ &lease -> scope, oc, MDL)) {
memcpy (raw.file, d1.data,
d1.len > sizeof raw.file ? sizeof raw.file : d1.len);
if (sizeof raw.file > d1.len)
memset (&raw.file [d1.len],
0, (sizeof raw.file) - d1.len);
- data_string_forget (&d1, "bootrequest");
+ data_string_forget (&d1, MDL);
} else
memcpy (raw.file, packet -> raw -> file, sizeof raw.file);
oc = lookup_option (&server_universe, options, SV_SERVER_NAME);
if (oc &&
evaluate_option_cache (&d1, packet, lease,
- packet -> options, options, oc)) {
+ packet -> options, options,
+ &lease -> scope, oc, MDL)) {
memcpy (raw.sname, d1.data,
d1.len > sizeof raw.sname ? sizeof raw.sname : d1.len);
if (sizeof raw.sname > d1.len)
memset (&raw.sname [d1.len],
0, (sizeof raw.sname) - d1.len);
- data_string_forget (&d1, "bootrequest");
+ data_string_forget (&d1, MDL);
}
/* Execute the commit statements, if there are any. */
execute_statements (packet, lease, packet -> options,
- options, lease -> on_commit);
+ options, &lease -> scope, lease -> on_commit);
/* We're done with the option state. */
- option_state_dereference (&options, "bootrequest");
- static_lease_dereference (lease, "bootrequest");
+ option_state_dereference (&options, MDL);
+ static_lease_dereference (lease, MDL);
/* Set up the hardware destination address... */
hto.hbuf [0] = packet -> raw -> htype;
#ifndef lint
static char copyright[] =
-"$Id: dhcp.c,v 1.132 2000/01/08 01:47:37 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium. All rights reserved.\n";
+"$Id: dhcp.c,v 1.133 2000/01/25 01:35:38 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
}
}
+ /* If it's an expired lease, get rid of any bindings. */
+ if (lease -> ends < cur_time && lease -> scope.bindings)
+ free_bindings (&lease -> scope, "dhcpdiscover");
+
/* Set the lease to really expire in 2 minutes, unless it has
not yet expired, in which case leave its expiry time alone. */
when = cur_time + 120;
if (oc &&
evaluate_option_cache (&data, packet, (struct lease *)0,
packet -> options, (struct option_state *)0,
- oc)) {
+ &global_scope, oc, MDL)) {
cip.len = 4;
memcpy (cip.iabuf, data.data, 4);
data_string_forget (&data, "dhcprequest");
if (oc &&
evaluate_option_cache (&data, packet, (struct lease *)0,
packet -> options, (struct option_state *)0,
- oc)) {
+ &global_scope, oc, MDL)) {
lease = find_lease_by_uid (data.data, data.len);
data_string_forget (&data, "dhcprelease");
break;
}
}
- } else {
- /* The client is supposed to pass a valid client-identifier,
- but the spec on this has changed historically, so try the
- IP address in ciaddr if the client-identifier fails. */
+ }
+
+ /* The client is supposed to pass a valid client-identifier,
+ but the spec on this has changed historically, so try the
+ IP address in ciaddr if the client-identifier fails. */
+ if (!lease) {
cip.len = 4;
memcpy (cip.iabuf, &packet -> raw -> ciaddr, 4);
lease = find_lease_by_ip_addr (cip);
if (!evaluate_option_cache (&data, packet, (struct lease *)0,
packet -> options,
(struct option_state *)0,
- oc))
+ &global_scope, oc, MDL))
return;
cip.len = 4;
/* Execute statements in scope starting with the subnet scope. */
if (lease)
execute_statements_in_scope (packet, (struct lease *)0,
- packet -> options,
- options, lease -> subnet -> group,
+ packet -> options, options,
+ &global_scope,
+ lease -> subnet -> group,
(struct group *)0);
/* Execute statements in the class scopes. */
for (i = packet -> class_count; i > 0; i--) {
execute_statements_in_scope
- (packet, (struct lease *)0, packet -> options,
- options, packet -> classes [i - 1] -> group,
+ (packet, (struct lease *)0, packet -> options, options,
+ &global_scope, packet -> classes [i - 1] -> group,
lease ? lease -> subnet -> group : (struct group *)0);
}
/* Drop the request if dhcpdeclines are being ignored. */
oc = lookup_option (&server_universe, options, SV_DECLINES);
if (!oc ||
- evaluate_boolean_option_cache (&ignorep,
- packet, lease, packet -> options,
- options, oc)) {
+ evaluate_boolean_option_cache (&ignorep, packet, lease,
+ packet -> options, options,
+ &lease -> scope, oc, MDL)) {
/* If we found a lease, mark it as unusable and complain. */
if (lease) {
abandon_lease (lease, "declined.");
/* Execute statements in scope starting with the subnet scope. */
if (subnet)
execute_statements_in_scope (packet, (struct lease *)0,
- packet -> options,
- options, subnet -> group,
+ packet -> options, options,
+ &global_scope, subnet -> group,
(struct group *)0);
/* Execute statements in the class scopes. */
for (i = packet -> class_count; i > 0; i--) {
execute_statements_in_scope
- (packet, (struct lease *)0, packet -> options,
- options, packet -> classes [i - 1] -> group,
+ (packet, (struct lease *)0, packet -> options, options,
+ &global_scope, packet -> classes [i - 1] -> group,
subnet ? subnet -> group : (struct group *)0);
}
if (oc &&
evaluate_option_cache (&d1, packet, (struct lease *)0,
packet -> options, (struct option_state *)0,
- oc)) {
+ &global_scope, oc, MDL)) {
i = d1.len;
if (i > sizeof raw.file)
i = sizeof raw.file;
if (oc &&
evaluate_option_cache (&d1, packet, (struct lease *)0,
packet -> options, (struct option_state *)0,
- oc)) {
+ &global_scope, oc, MDL)) {
i = d1.len;
if (i > sizeof raw.sname)
i = sizeof raw.sname;
DHO_HOST_NAME))) {
if (evaluate_option_cache (&d1, packet, (struct lease *)0,
packet -> options, options,
- oc)) {
+ &global_scope, oc, MDL)) {
if (d1.data [d1.len - 1] == '\0')
nulltp = 1;
data_string_forget (&d1, "dhcpinform");
from = packet -> interface -> primary_address;
} else {
if (evaluate_option_cache (&d1, packet, (struct lease *)0,
- packet -> options, options, oc)) {
+ packet -> options, options,
+ &global_scope, oc, MDL)) {
if (!d1.len || d1.len != sizeof from) {
data_string_forget (&d1, "dhcpinform");
goto use_primary;
if (!lookup_option (&dhcp_universe, options, i) &&
(oc = lookup_option (&server_universe, options, j)) &&
evaluate_option_cache (&d1, packet, (struct lease *)0,
- packet -> options, options, oc)) {
+ packet -> options, options,
+ &global_scope, oc, MDL)) {
oc = (struct option_cache *)0;
if (option_cache_allocate (&oc, "dhcpinform")) {
if (make_encapsulation (&oc -> expression, &d1)) {
i = SV_SITE_OPTION_SPACE;
if ((oc = lookup_option (&server_universe, options, i)) &&
evaluate_option_cache (&d1, packet, (struct lease *)0,
- packet -> options, options, oc)) {
+ packet -> options, options,
+ &global_scope, oc, MDL)) {
const struct universe *u;
u = ((const struct universe *)
if (oc)
evaluate_option_cache (&prl, packet, (struct lease *)0,
- packet -> options, options, oc);
+ packet -> options, options,
+ &global_scope, oc, MDL);
#ifdef DEBUG_PACKET
dump_packet (packet);
if ((oc =
lookup_option (&server_universe, options, SV_NEXT_SERVER))) {
if (evaluate_option_cache (&d1, packet, (struct lease *)0,
- packet -> options, options, oc)) {
+ packet -> options, options,
+ &global_scope, oc, MDL)) {
/* If there was more than one answer,
take the first. */
if (d1.len >= 4 && d1.data)
/* Set up the option buffer... */
outgoing.packet_length =
cons_options (packet, outgoing.raw, (struct lease *)0,
- 0, packet -> options, options, 0, nulltp, 0,
+ 0, packet -> options, options, &global_scope,
+ 0, nulltp, 0,
prl.len ? &prl : (struct data_string *)0);
option_state_dereference (&options, "dhcpinform");
data_string_forget (&prl, "dhcpinform");
/* Set up the option buffer... */
outgoing.packet_length =
cons_options (packet, outgoing.raw, (struct lease *)0,
- 0, packet -> options, options, 0, 0, 0,
- (struct data_string *)0);
+ 0, packet -> options, options, &global_scope,
+ 0, 0, 0, (struct data_string *)0);
option_state_dereference (&options, "nak_lease");
/* memset (&raw.ciaddr, 0, sizeof raw.ciaddr);*/
if (oc)
s1 = evaluate_option_cache (&d1, packet, (struct lease *)0,
packet -> options,
- (struct option_state *)0, oc);
- if (oc && status &&
+ (struct option_state *)0,
+ &global_scope, oc, MDL);
+ if (oc && s1 &&
lease -> client_hostname &&
strlen (lease -> client_hostname) == d1.len &&
!memcmp (lease -> client_hostname, d1.data, d1.len)) {
/* Execute statements in scope starting with the subnet scope. */
execute_statements_in_scope (packet, lease,
packet -> options,
- state -> options,
+ state -> options, &lease -> scope,
lease -> subnet -> group,
(struct group *)0);
if (lease -> pool)
execute_statements_in_scope (packet, lease,
packet -> options,
- state -> options,
+ state -> options, &lease -> scope,
lease -> pool -> group,
lease -> subnet -> group);
for (i = packet -> class_count; i > 0; i--) {
execute_statements_in_scope
(packet, lease, packet -> options, state -> options,
- packet -> classes [i - 1] -> group,
+ &lease -> scope, packet -> classes [i - 1] -> group,
(lease -> pool
? lease -> pool -> group
: lease -> subnet -> group));
with its group. */
if (lease -> host)
execute_statements_in_scope (packet, lease, packet -> options,
- state -> options,
+ state -> options, &lease -> scope,
lease -> host -> group,
(lease -> pool
? lease -> pool -> group
SV_ONE_LEASE_PER_CLIENT)) &&
evaluate_boolean_option_cache (&ignorep,
packet, lease, packet -> options,
- state -> options, oc)) {
+ state -> options, &lease -> scope,
+ oc, MDL)) {
struct lease *seek;
if (lease -> uid_len) {
do {
SV_DUPLICATES)) &&
!evaluate_boolean_option_cache (&ignorep, packet, lease,
packet -> options,
- state -> options, oc))) {
+ state -> options,
+ &lease -> scope,
+ oc, MDL))) {
do {
seek = (find_lease_by_hw_addr
(lease -> hardware_addr.hbuf,
SV_MIN_SECS))) {
if (evaluate_option_cache (&d1, packet, lease,
packet -> options, state -> options,
- oc)) {
+ &lease -> scope, oc, MDL)) {
if (d1.len && packet -> raw -> secs < d1.data [0]) {
- data_string_forget (&d1, "ack_lease");
log_info ("%s: %d secs < %d", msg,
packet -> raw -> secs, d1.data [0]);
+ data_string_forget (&d1, "ack_lease");
free_lease_state (state, "ack_lease");
static_lease_dereference (lease, "ack_lease");
return;
if (oc &&
evaluate_option_cache (&d1, packet, lease,
packet -> options, state -> options,
- oc)) {
+ &lease -> scope, oc, MDL)) {
hp = find_hosts_by_uid (d1.data, d1.len);
data_string_forget (&d1, "dhcpdiscover");
if (!hp)
SV_BOOT_UNKNOWN_CLIENTS)) &&
!evaluate_boolean_option_cache (&ignorep,
packet, lease, packet -> options,
- state -> options, oc)) {
+ state -> options,
+ &lease -> scope, oc, MDL)) {
if (!ignorep)
log_info ("%s: unknown client", msg);
free_lease_state (state, "ack_lease");
SV_ALLOW_BOOTP)) &&
!evaluate_boolean_option_cache (&ignorep,
packet, lease, packet -> options,
- state -> options, oc)) {
+ state -> options,
+ &lease -> scope, oc, MDL)) {
if (!ignorep)
log_info ("%s: bootp disallowed", msg);
free_lease_state (state, "ack_lease");
if (oc &&
!evaluate_boolean_option_cache (&ignorep,
packet, lease, packet -> options,
- state -> options, oc)) {
+ state -> options,
+ &lease -> scope, oc, MDL)) {
if (!ignorep)
log_info ("%s: booting disallowed", msg);
free_lease_state (state, "ack_lease");
if (oc)
evaluate_option_cache (&state -> filename, packet, lease,
packet -> options, state -> options,
- oc);
+ &lease -> scope, oc, MDL);
/* Choose a server name as above. */
oc = lookup_option (&server_universe, state -> options,
if (oc)
evaluate_option_cache (&state -> server_name, packet, lease,
packet -> options, state -> options,
- oc);
+ &lease -> scope, oc, MDL);
/* At this point, we have a lease that we can offer the client.
Now we construct a lease structure that contains what we want,
SV_DEFAULT_LEASE_TIME))) {
if (evaluate_option_cache (&d1, packet, lease,
packet -> options,
- state -> options, oc)) {
+ state -> options,
+ &lease -> scope, oc, MDL)) {
if (d1.len == sizeof (u_int32_t))
default_lease_time =
getULong (d1.data);
DHO_DHCP_LEASE_TIME)))
s1 = evaluate_option_cache (&d1, packet, lease,
packet -> options,
- state -> options, oc);
+ state -> options,
+ &lease -> scope, oc, MDL);
else
s1 = 0;
if (s1 && d1.len == sizeof (u_int32_t)) {
SV_MAX_LEASE_TIME))) {
if (evaluate_option_cache (&d1, packet, lease,
packet -> options,
- state -> options, oc)) {
+ state -> options,
+ &lease -> scope, oc, MDL)) {
if (d1.len == sizeof (u_int32_t))
max_lease_time =
getULong (d1.data);
SV_MIN_LEASE_TIME))) {
if (evaluate_option_cache (&d1, packet, lease,
packet -> options,
- state -> options, oc)) {
+ state -> options,
+ &lease -> scope, oc, MDL)) {
if (d1.len == sizeof (u_int32_t))
min_lease_time = getULong (d1.data);
data_string_forget (&d1, "ack_lease");
if (evaluate_option_cache (&d1, packet, lease,
packet -> options,
state -> options,
- oc)) {
+ &lease -> scope, oc, MDL)) {
if (d1.len == sizeof (u_int32_t))
lease_time = getULong (d1.data);
data_string_forget (&d1, "ack_lease");
if (evaluate_option_cache (&d1, packet, lease,
packet -> options,
state -> options,
- oc)) {
+ &lease -> scope, oc, MDL)) {
if (d1.len == sizeof (u_int32_t))
lease_time = (getULong (d1.data) -
cur_time);
DHO_DHCP_CLIENT_IDENTIFIER);
if (oc &&
evaluate_option_cache (&d1, packet, lease,
- packet -> options, state -> options, oc)) {
+ packet -> options, state -> options,
+ &lease -> scope, oc, MDL)) {
if (d1.len <= sizeof lt.uid_buf) {
memcpy (lt.uid_buf, d1.data, d1.len);
lt.uid = lt.uid_buf;
committed, execute them. */
if (lease -> on_commit && (!offer || offer == DHCPACK)) {
execute_statements (packet, lease, packet -> options,
- state -> options, lease -> on_commit);
- executable_statement_dereference (&lease -> on_commit,
- "ack_lease");
+ state -> options, &lease -> scope,
+ lease -> on_commit);
+ if (lease -> on_commit)
+ executable_statement_dereference (&lease -> on_commit,
+ "ack_lease");
}
+ /* Save any bindings. */
+ lt.scope.bindings = lease -> scope.bindings;
+ lease -> scope.bindings = (struct binding *)0;
+
/* Don't call supersede_lease on a mocked-up lease. */
if (lease -> flags & STATIC_LEASE) {
/* Copy the hardware address into the static lease
SV_ALWAYS_BROADCAST)) &&
evaluate_boolean_option_cache (&ignorep, packet, lease,
packet -> options, state -> options,
- oc))
+ &lease -> scope, oc, MDL))
state -> bootp_flags |= htons (BOOTP_BROADCAST);
/* Get the Maximum Message Size option from the packet, if one
DHO_DHCP_MAX_MESSAGE_SIZE);
if (oc &&
evaluate_option_cache (&d1, packet, lease,
- packet -> options, state -> options, oc)) {
+ packet -> options, state -> options,
+ &lease -> scope, oc, MDL)) {
if (d1.len == sizeof (u_int16_t))
state -> max_message_size = getUShort (d1.data);
data_string_forget (&d1, "ack_lease");
} else {
if (evaluate_option_cache (&d1, packet, lease,
packet -> options,
- state -> options, oc)) {
+ state -> options,
+ &lease -> scope, oc, MDL)) {
if (!d1.len ||
d1.len > sizeof state -> from.iabuf) {
data_string_forget (&d1, "ack_lease");
state -> options, SV_NEXT_SERVER))) {
if (evaluate_option_cache (&d1, packet, lease,
packet -> options, state -> options,
- oc)) {
+ &lease -> scope, oc, MDL)) {
/* If there was more than one answer,
take the first. */
if (d1.len >= 4 && d1.data)
lease -> host && lease -> host -> name &&
(evaluate_boolean_option_cache
(&ignorep, packet, lease, packet -> options, state -> options,
- (lookup_option
- (&server_universe, state -> options, j))))) {
+ &lease -> scope,
+ lookup_option (&server_universe, state -> options, j), MDL))) {
oc = (struct option_cache *)0;
if (option_cache_allocate (&oc, "ack_lease")) {
if (make_const_data (&oc -> expression,
if (!lookup_option (&server_universe, state -> options, i) &&
(evaluate_boolean_option_cache
(&ignorep, packet, lease, packet -> options, state -> options,
- lookup_option (&server_universe, state -> options, j)))) {
+ &lease -> scope, lookup_option (&server_universe,
+ state -> options, j), MDL))) {
struct in_addr ia;
struct hostent *h;
if (evaluate_boolean_option_cache
(&ignorep, packet, lease, packet -> options, state -> options,
+ &lease -> scope,
lookup_option (&server_universe, state -> options,
- SV_USE_LEASE_ADDR_FOR_DEFAULT_ROUTE))) {
+ SV_USE_LEASE_ADDR_FOR_DEFAULT_ROUTE), MDL)) {
i = DHO_ROUTERS;
oc = lookup_option (&dhcp_universe, state -> options, i);
if (!oc) {
if (!lookup_option (&dhcp_universe, state -> options, i) &&
(oc = lookup_option (&server_universe, state -> options, j)) &&
evaluate_option_cache (&d1, packet, lease,
- packet -> options, state -> options, oc)) {
+ packet -> options, state -> options,
+ &lease -> scope, oc, MDL)) {
oc = (struct option_cache *)0;
if (option_cache_allocate (&oc, "ack_lease")) {
if (make_encapsulation (&oc -> expression, &d1)) {
i = SV_SITE_OPTION_SPACE;
if ((oc = lookup_option (&server_universe, state -> options, i)) &&
evaluate_option_cache (&d1, packet, lease,
- packet -> options, state -> options, oc)) {
+ packet -> options, state -> options,
+ &lease -> scope, oc, MDL)) {
const struct universe *u;
u = ((const struct universe *)
evaluate_option_cache (&state -> parameter_request_list,
packet, lease,
packet -> options, state -> options,
- oc);
+ &lease -> scope, oc, MDL);
#ifdef DEBUG_PACKET
dump_packet (packet);
packet_length = cons_options (state -> packet, &raw, lease,
state -> max_message_size,
state -> packet -> options,
- state -> options,
+ state -> options, &global_scope,
bufs, nulltp, bootpp,
&state -> parameter_request_list);
raw.siaddr, &to,
(struct hardware *)0);
- data_string_forget (&state -> parameter_request_list,
- "dhcp_reply");
free_lease_state (state, "dhcp_reply fallback 1");
lease -> state = (struct lease_state *)0;
return;
&raw, packet_length,
raw.siaddr, &to,
(struct hardware *)0);
- data_string_forget (&state -> parameter_request_list,
- "dhcp_reply");
free_lease_state (state, "dhcp_reply fallback 2");
lease -> state = (struct lease_state *)0;
return;
/* Free all of the entries in the option_state structure
now that we're done with them. */
- data_string_forget (&state -> parameter_request_list,
- "dhcp_reply");
free_lease_state (state, "dhcp_reply");
lease -> state = (struct lease_state *)0;
}
if (oc &&
evaluate_option_cache (&d1, packet, (struct lease *)0,
packet -> options, (struct option_state *)0,
- oc)) {
+ &global_scope, oc, MDL)) {
packet -> got_requested_address = 1;
cip.len = 4;
memcpy (cip.iabuf, d1.data, cip.len);
evaluate_option_cache (&client_identifier,
packet, (struct lease *)0,
packet -> options, (struct option_state *)0,
- oc)) {
+ &global_scope, oc, MDL)) {
/* Remember this for later. */
have_client_identifier = 1;
if (uid_lease) {
if (uid_lease -> ends > cur_time) {
log_error ("client %s has duplicate%s on %s",
- " leases",
(print_hw_addr
(packet -> raw -> htype,
packet -> raw -> hlen,
packet -> raw -> chaddr)),
- (ip_lease -> subnet ->
- shared_network -> name));
+ " leases",
+ (ip_lease -> subnet ->
+ shared_network -> name));
/* If the client is REQUESTing the lease,
it shouldn't still be using the old
executable_statement_dereference (&lease -> on_expiry, name);
if (lease -> on_commit)
executable_statement_dereference (&lease -> on_commit, name);
+ if (&lease -> scope)
+ free_bindings (&lease -> scope, name);
}
/* Look through all the pools in a list starting with the specified pool