]> git.ipfire.org Git - thirdparty/dhcp.git/commitdiff
Do classing for BOOTP clients as well as DHCP clients.
authorTed Lemon <source@isc.org>
Thu, 10 Jun 1999 00:36:27 +0000 (00:36 +0000)
committerTed Lemon <source@isc.org>
Thu, 10 Jun 1999 00:36:27 +0000 (00:36 +0000)
server/bootp.c
server/dhcp.c

index 552abe47eb97e93d6adec5179972bda0d8f923a9..443c0a8cb214fd0d3f46ac6747d06db00138da71 100644 (file)
@@ -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,
index 9d3330a40e0e00e8582f6b88b1aa9dd32187d077..ba4df7e970b5ed2501ee730dd00e2af9654d7460 100644 (file)
@@ -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