]> git.ipfire.org Git - thirdparty/dhcp.git/commitdiff
Add seperate implementation for config-option.
authorTed Lemon <source@isc.org>
Wed, 21 Jul 1999 19:26:55 +0000 (19:26 +0000)
committerTed Lemon <source@isc.org>
Wed, 21 Jul 1999 19:26:55 +0000 (19:26 +0000)
common/tree.c

index bae5628245ad9e10d772488275729e6740e8858d..27e853473a301b2157535fb90b6eef1bf2299cb4 100644 (file)
@@ -22,7 +22,7 @@
 
 #ifndef lint
 static char copyright[] =
-"$Id: tree.c,v 1.40 1999/07/21 14:28:57 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998 The Internet Software Consortium.  All rights reserved.\n";
+"$Id: tree.c,v 1.41 1999/07/21 19:26:55 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998 The Internet Software Consortium.  All rights reserved.\n";
 #endif /* not lint */
 
 #include "dhcpd.h"
@@ -703,7 +703,6 @@ int evaluate_data_expression (result, packet, options, lease, expr)
 
                /* Extract an option. */
              case expr_option:
-             case expr_config_option:
                if (options)
                        s0 = ((*expr -> data.option -> universe -> get_func)
                              (result, expr -> data.option -> universe,
@@ -721,6 +720,24 @@ int evaluate_data_expression (result, packet, options, lease, expr)
 #endif
                return s0;
 
+             case expr_config_option:
+               if (lease -> state && lease -> state -> options)
+                       s0 = ((*expr -> data.option -> universe -> get_func)
+                             (result, expr -> data.option -> universe,
+                              packet, lease, lease -> state -> options,
+                              expr -> data.option -> code));
+               else
+                       s0 = 0;
+
+#if defined (DEBUG_EXPRESSIONS)
+               log_debug ("data: config-option %s.%s = %s",
+                     expr -> data.option -> universe -> name,
+                     expr -> data.option -> name,
+                     s0 ? print_hex_1 (result -> len, result -> data, 60)
+                     : "NULL");
+#endif
+               return s0;
+
                /* Combine the hardware type and address. */
              case expr_hardware:
                if (!packet || !packet -> raw) {