2
0
mirror of https://gitlab.isc.org/isc-projects/dhcp synced 2025-09-01 14:55:30 +00:00

Clean up some of the boolean config option support.

This commit is contained in:
Ted Lemon
1999-10-20 16:52:25 +00:00
parent fe849040b5
commit ddb4c2ace3

View File

@@ -22,7 +22,7 @@
#ifndef lint #ifndef lint
static char copyright[] = static char copyright[] =
"$Id: dhcp.c,v 1.118 1999/10/15 15:14:31 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium. All rights reserved.\n"; "$Id: dhcp.c,v 1.119 1999/10/20 16:52:25 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */ #endif /* not lint */
#include "dhcpd.h" #include "dhcpd.h"
@@ -1027,48 +1027,36 @@ void ack_lease (packet, lease, offer, when, msg)
lease -> host = (struct host_decl *)0; lease -> host = (struct host_decl *)0;
} }
/* Drop the request if it's not allowed for this client. */ /* Drop the request if it's not allowed for this client. By
default, unknown clients are allowed. */
if (!lease -> host && if (!lease -> host &&
(oc = lookup_option (&server_universe, state -> options, (oc = lookup_option (&server_universe, state -> options,
SV_BOOT_UNKNOWN_CLIENTS))) { SV_BOOT_UNKNOWN_CLIENTS)) &&
if (evaluate_option_cache (&d1, packet, lease, !evaluate_boolean_option_cache (packet, lease, packet -> options,
packet -> options, state -> options, state -> options, oc)) {
oc)) { free_lease_state (state, "ack_lease");
if (d1.len && !d1.data [0]) { static_lease_dereference (lease, "ack_lease");
log_info ("%s: unknown", msg); return;
data_string_forget (&d1, "ack_lease");
free_lease_state (state, "ack_lease");
static_lease_dereference (lease, "ack_lease");
return;
}
data_string_forget (&d1, "ack_lease"); /* mmm, C... */
}
} }
/* Drop the request if it's not allowed for this client. */ /* Drop the request if it's not allowed for this client. */
if (!offer && if (!offer &&
(oc = lookup_option (&server_universe, state -> options, (oc = lookup_option (&server_universe, state -> options,
SV_ALLOW_BOOTP))) { SV_ALLOW_BOOTP)) &&
if (evaluate_option_cache (&d1, packet, lease, !evaluate_boolean_option_cache (packet, lease, packet -> options,
packet -> options, state -> options, state -> options, oc)) {
oc)) { log_info ("%s: bootp disallowed", msg);
if (d1.len && !d1.data [0]) { free_lease_state (state, "ack_lease");
data_string_forget (&d1, "ack_lease"); static_lease_dereference (lease, "ack_lease");
log_info ("%s: bootp disallowed", msg); return;
free_lease_state (state, "ack_lease");
static_lease_dereference (lease, "ack_lease");
return;
}
data_string_forget (&d1, "ack_lease");
}
} }
/* Drop the request if booting is specifically denied. */ /* Drop the request if booting is specifically denied. */
oc = lookup_option (&server_universe, state -> options, oc = lookup_option (&server_universe, state -> options,
SV_ALLOW_BOOTING); SV_ALLOW_BOOTING);
if (oc && if (oc &&
evaluate_option_cache (&d1, packet, lease, !evaluate_boolean_option_cache (packet, lease, packet -> options,
packet -> options, state -> options, oc)) { state -> options, oc)) {
if (d1.len && !d1.data [0]) { if (d1.len && !d1.data [0]) {
log_info ("%s: booting disallowed", msg); log_info ("%s: booting disallowed", msg);
data_string_forget (&d1, "ack_lease"); data_string_forget (&d1, "ack_lease");