summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Lemon <source@isc.org>1999-06-10 00:36:27 +0000
committerTed Lemon <source@isc.org>1999-06-10 00:36:27 +0000
commitfa661adb98c22e5230ccc06677e2d0d791638d1e (patch)
treef6e6f2a6a83ddaa66f60816137ef80b647be7cb5
parent285da7c75d7fa3f959c78c2f0e411203bdc6aa8f (diff)
downloadisc-dhcp-fa661adb98c22e5230ccc06677e2d0d791638d1e.tar.gz
Do classing for BOOTP clients as well as DHCP clients.
-rw-r--r--server/bootp.c16
-rw-r--r--server/dhcp.c19
2 files changed, 20 insertions, 15 deletions
diff --git a/server/bootp.c b/server/bootp.c
index 552abe47..443c0a8c 100644
--- a/server/bootp.c
+++ b/server/bootp.c
@@ -22,7 +22,7 @@
#ifndef lint
static char copyright[] =
-"$Id: bootp.c,v 1.46 1999/05/27 14:58:07 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium. All rights reserved.\n";
+"$Id: bootp.c,v 1.47 1999/06/10 00:36:18 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
@@ -117,13 +117,21 @@ void bootp (packet)
option_state_allocate (&options, "bootrequest");
/* Execute the subnet statements. */
- execute_statements_in_scope (packet, options, options,
+ execute_statements_in_scope (packet, packet -> options, options,
lease -> subnet -> group,
(struct group *)0);
+ /* Execute statements from class scopes. */
+ for (i = packet -> class_count; i > 0; i--) {
+ execute_statements_in_scope
+ (packet, packet -> options, options,
+ packet -> classes [i - 1] -> group,
+ lease -> subnet -> group);
+ }
+
/* Execute the host statements. */
- execute_statements_in_scope (packet, options, options, hp -> group,
- hp -> group);
+ execute_statements_in_scope (packet, packet -> options, options,
+ hp -> group, subnet -> group);
/* Drop the request if it's not allowed for this client. */
if (evaluate_boolean_option_cache (packet, options,
diff --git a/server/dhcp.c b/server/dhcp.c
index 9d3330a4..ba4df7e9 100644
--- a/server/dhcp.c
+++ b/server/dhcp.c
@@ -22,7 +22,7 @@
#ifndef lint
static char copyright[] =
-"$Id: dhcp.c,v 1.91 1999/05/27 14:56:51 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium. All rights reserved.\n";
+"$Id: dhcp.c,v 1.92 1999/06/10 00:36:27 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
@@ -856,16 +856,13 @@ void ack_lease (packet, lease, offer, when, msg)
lease -> subnet -> group);
/* Execute statements from class scopes. */
- if (offer) {
- for (i = packet -> class_count; i > 0; i--) {
- execute_statements_in_scope
- (packet, packet -> options,
- state -> options,
- packet -> classes [i - 1] -> group,
- (lease -> pool
- ? lease -> pool -> group
- : lease -> subnet -> group));
- }
+ for (i = packet -> class_count; i > 0; i--) {
+ execute_statements_in_scope
+ (packet, packet -> options, state -> options,
+ packet -> classes [i - 1] -> group,
+ (lease -> pool
+ ? lease -> pool -> group
+ : lease -> subnet -> group));
}
/* If we have a host_decl structure, run the options associated