summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Lemon <source@isc.org>2000-09-14 12:42:01 +0000
committerTed Lemon <source@isc.org>2000-09-14 12:42:01 +0000
commit89c425dd29dd059df010bbc02d059f13e83f7cf6 (patch)
tree5d446cd6639bd58e33a61e42d7654f36c25a462f
parent86ec3f8cd4399f0f87b3be046fbec32b147b2305 (diff)
downloadisc-dhcp-89c425dd29dd059df010bbc02d059f13e83f7cf6.tar.gz
Do statements before using option values (e.g., lease duration).
-rw-r--r--client/dhclient.c27
1 files changed, 17 insertions, 10 deletions
diff --git a/client/dhclient.c b/client/dhclient.c
index 67ad86dd..a0d7c402 100644
--- a/client/dhclient.c
+++ b/client/dhclient.c
@@ -41,7 +41,7 @@
#ifndef lint
static char ocopyright[] =
-"$Id: dhclient.c,v 1.112 2000/09/01 23:06:34 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998, 1999 Internet Software Consortium. All rights reserved.\n";
+"$Id: dhclient.c,v 1.113 2000/09/14 12:42:01 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998, 1999 Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
@@ -227,6 +227,7 @@ int main (argc, argv, envp)
log_info (copyright);
log_info (arr);
log_info (url);
+ log_info ("%s", "");
} else
log_perror = 0;
@@ -411,9 +412,14 @@ int main (argc, argv, envp)
static void usage ()
{
+ log_info ("%s %s", message, DHCP_VERSION);
+ log_info (copyright);
+ log_info (arr);
+ log_info (url);
+
log_error ("Usage: dhclient [-d] [-D] [-q] [-p <port>] %s",
"[-s server]");
- log_error (" [-lf lease-file] [-pf pid-file]%s",
+ log_fatal (" [-lf lease-file] [-pf pid-file]%s",
"[-cf config-file] [interface]");
}
@@ -1071,7 +1077,7 @@ struct client_lease *packet_to_lease (packet, client)
lease = (struct client_lease *)new_client_lease (MDL);
if (!lease) {
- log_error ("dhcpoffer: no memory to record lease.\n");
+ log_error ("packet_to_lease: no memory to record lease.\n");
return (struct client_lease *)0;
}
@@ -1137,6 +1143,14 @@ struct client_lease *packet_to_lease (packet, client)
lease -> filename [len] = 0;
}
}
+
+ execute_statements_in_scope ((struct binding_value **)0,
+ (struct packet *)packet,
+ (struct lease *)0, lease -> options,
+ lease -> options, &global_scope,
+ client -> config -> on_receipt,
+ (struct group *)0);
+
return lease;
}
@@ -2227,13 +2241,6 @@ void script_write_params (client, prefix, lease)
client_envadd (client, prefix, "server_name",
"%s", lease -> server_name);
- execute_statements_in_scope ((struct binding_value **)0,
- (struct packet *)0,
- (struct lease *)0, lease -> options,
- lease -> options, &global_scope,
- client -> config -> on_receipt,
- (struct group *)0);
-
hash = lease -> options -> universes [dhcp_universe.index];
for (i = 0; i < OPTION_HASH_SIZE; i++) {
pair hp;