From: Ted Lemon Date: Wed, 21 Jul 1999 19:26:55 +0000 (+0000) Subject: Add seperate implementation for config-option. X-Git-Tag: V3-BETA-1-PATCH-2~5^2~167 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e23f8b44f65189b58a61a802c167c43df3bee8f5;p=thirdparty%2Fdhcp.git Add seperate implementation for config-option. --- diff --git a/common/tree.c b/common/tree.c index bae562824..27e853473 100644 --- a/common/tree.c +++ b/common/tree.c @@ -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) {