aboutsummaryrefslogtreecommitdiff
path: root/contrib/isc-dhcp/client
diff options
context:
space:
mode:
authorDavid E. O'Brien <obrien@FreeBSD.org>1999-05-02 09:03:51 +0000
committerDavid E. O'Brien <obrien@FreeBSD.org>1999-05-02 09:03:51 +0000
commitf96b6240a8bcccf45bd5180f78bf9512c3339a18 (patch)
tree75c1496cd45733a402c0090488b97a6f92f09d2f /contrib/isc-dhcp/client
parentcb1dd5d1b3d7429a2e45c616552023c5729be0c5 (diff)
downloadsrc-f96b6240a8bcccf45bd5180f78bf9512c3339a18.tar.gz
src-f96b6240a8bcccf45bd5180f78bf9512c3339a18.zip
Virgin import of ISC-DHCP v2.0b1pl27
Notes
Notes: svn path=/vendor/isc-dhcp/dist/; revision=46275
Diffstat (limited to 'contrib/isc-dhcp/client')
-rw-r--r--contrib/isc-dhcp/client/clparse.c27
-rw-r--r--contrib/isc-dhcp/client/dhclient-script.852
-rw-r--r--contrib/isc-dhcp/client/dhclient.c127
-rw-r--r--contrib/isc-dhcp/client/dhclient.conf.516
-rwxr-xr-xcontrib/isc-dhcp/client/scripts/freebsd44
5 files changed, 177 insertions, 89 deletions
diff --git a/contrib/isc-dhcp/client/clparse.c b/contrib/isc-dhcp/client/clparse.c
index e55ea6106949..65acbc803cb3 100644
--- a/contrib/isc-dhcp/client/clparse.c
+++ b/contrib/isc-dhcp/client/clparse.c
@@ -42,16 +42,13 @@
#ifndef lint
static char copyright[] =
-"$Id: clparse.c,v 1.13.2.2 1998/07/10 23:17:00 mellon Exp $ Copyright (c) 1997 The Internet Software Consortium. All rights reserved.\n";
+"$Id: clparse.c,v 1.13.2.4 1999/03/29 21:21:37 mellon Exp $ Copyright (c) 1997 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
#include "dhctoken.h"
-static TIME parsed_time;
-
struct client_config top_level_config;
-u_int32_t requested_lease_time;
/* client-conf-file :== client-declarations EOF
client-declarations :== <nil>
@@ -63,9 +60,7 @@ int read_client_conf ()
FILE *cfile;
char *val;
int token;
- int declaration = 0;
struct client_config *config;
- struct client_state *state;
struct interface_info *ip;
new_parse (path_dhclient_conf);
@@ -81,8 +76,8 @@ int read_client_conf ()
top_level_config.select_interval = 0;
top_level_config.reboot_timeout = 10;
top_level_config.retry_interval = 300;
- top_level_config.backoff_cutoff = 120;
- top_level_config.initial_interval = 10;
+ top_level_config.backoff_cutoff = 15;
+ top_level_config.initial_interval = 3;
top_level_config.bootp_policy = ACCEPT;
top_level_config.script_name = "/etc/dhclient-script";
top_level_config.requested_options
@@ -106,11 +101,6 @@ int read_client_conf ()
top_level_config.requested_options
[top_level_config.requested_option_count++] =
DHO_HOST_NAME;
- requested_lease_time = 7200;
- top_level_config.send_options [DHO_DHCP_LEASE_TIME].data
- = (unsigned char *)&requested_lease_time;
- top_level_config.send_options [DHO_DHCP_LEASE_TIME].len
- = sizeof requested_lease_time;
if ((cfile = fopen (path_dhclient_conf, "r")) != NULL) {
do {
@@ -333,7 +323,6 @@ int parse_X (cfile, buf, max)
int token;
char *val;
int len;
- u_int8_t *s;
token = peek_token (&val, cfile);
if (token == NUMBER_OR_NAME || token == NUMBER) {
@@ -427,9 +416,7 @@ void parse_interface_declaration (cfile, outer_config)
int token;
char *val;
- struct interface_info dummy_interface, *ip;
- struct client_state dummy_state;
- struct client_config dummy_config;
+ struct interface_info *ip;
token = next_token (&val, cfile);
if (token != STRING) {
@@ -664,7 +651,6 @@ void parse_client_lease_declaration (cfile, lease, ipp)
{
int token;
char *val;
- char *t, *n;
struct interface_info *ip;
switch (next_token (&val, cfile)) {
@@ -810,11 +796,6 @@ struct option *parse_option_decl (cfile, options)
/* Parse the option data... */
do {
- /* Set a flag if this is an array of a simple type (i.e.,
- not an array of pairs of IP addresses, or something
- like that. */
- int uniform = option -> format [1] == 'A';
-
for (fmt = option -> format; *fmt; fmt++) {
if (*fmt == 'A')
break;
diff --git a/contrib/isc-dhcp/client/dhclient-script.8 b/contrib/isc-dhcp/client/dhclient-script.8
index 6d1c9b72d004..51ccbe9c7da5 100644
--- a/contrib/isc-dhcp/client/dhclient-script.8
+++ b/contrib/isc-dhcp/client/dhclient-script.8
@@ -35,7 +35,7 @@
.\" Enterprises. To learn more about the Internet Software Consortium,
.\" see ``http://www.isc.org/isc''. To learn more about Vixie
.\" Enterprises, see ``http://www.vix.com''.
-.TH dhclient 8
+.TH dhclient-script 8
.SH NAME
dhclient-script - DHCP client network configuration script
.SH DESCRIPTION
@@ -47,15 +47,49 @@ interface's final configuration once a lease has been acquired. If no
lease is acquired, the script is used to test predefined leases, if
any, and also called once if no valid lease can be identified.
.PP
-This script is not meant to be customized by the end user. However,
-the script may not work on particular versions of particular operating
-systems (indeed, no standard script exists for some operating
-systems), so a pioneering user may well need to create a new script or
-modify an existing one. In general, customizations specific to a
-particular computer should be done in the
+This script is not meant to be customized by the end user. If local
+customizations are needed, they should be possible using the enter and
+exit hooks provided (see HOOKS for details). These hooks will allow the
+user to override the default behaviour of the client in creating a
+.B /etc/resolv.conf
+file.
+.PP
+No standard client script exists for some operating systems, even though
+the actual client may work, so a pioneering user may well need to create
+a new script or modify an existing one. In general, customizations specific
+to a particular computer should be done in the
+.B ETCDIR/dhclient.conf
+file. If you find that you can't make such a customization without
+customizing
.B ETCDIR/dhclient.conf
-script. If you find that you can't make such a customization without
-customizing dhclient-script, please submit a bug report.
+or using the enter and exit hooks, please submit a bug report.
+.SH HOOKS
+When it starts, the client script first defines a shell function,
+.B make_resolv_conf ,
+which is later used to create the
+.B /etc/resolv.conf
+file. To override the default behaviour, redefine this function in
+the enter hook script.
+.PP
+On after defining the make_resolv_conf function, the client script checks
+for the presence of an executable
+.B ETCDIR/dhclient-enter-hooks
+script, and if present, it invokes the script inline, using the Bourne
+shell '.' command. The entire environment documented under OPERATION
+is available to this script, which may modify the environment if needed
+to change the behaviour of the script. If an error occurs during the
+execution of the script, it can set the exit_status variable to a nonzero
+value, and
+.B ETCDIR/dhclient-script
+will exit with that error code immediately after the client script exits.
+.PP
+After all processing has completed,
+.B ETCDIR/dhclient-script
+checks for the presence of an executable
+.B ETCDIR/dhclient-exit-hooks
+script, which if present is invoked using the '.' command. The exit status
+is passed in the exit_status shell variable, and will always be zero if the
+script succeeded at the task for which it was invoked.
.SH OPERATION
When dhclient needs to invoke the client configuration script, it
writes a shell script into /tmp which defines a variety of variables.
diff --git a/contrib/isc-dhcp/client/dhclient.c b/contrib/isc-dhcp/client/dhclient.c
index 4d33f413e5d4..9ac4aea17a8d 100644
--- a/contrib/isc-dhcp/client/dhclient.c
+++ b/contrib/isc-dhcp/client/dhclient.c
@@ -56,7 +56,7 @@
#ifndef lint
static char ocopyright[] =
-"$Id: dhclient.c,v 1.44.2.25 1999/03/05 16:13:54 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium. All rights reserved.\n";
+"$Id: dhclient.c,v 1.44.2.37 1999/04/24 16:55:19 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
@@ -92,11 +92,11 @@ int save_scripts;
static char copyright[] =
"Copyright 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium.";
static char arr [] = "All rights reserved.";
-static char message [] = "Internet Software Consortium DHCP Client V2.0b1pl18";
-static char contrib [] = "\nPlease contribute if you find this software useful.";
-static char url [] = "For info, please visit http://www.isc.org/dhcp-contrib.html\n";
+static char message [] = "Internet Software Consortium DHCP Client V2.0b1pl27";
+static char contrib [] = "Please contribute if you find this software useful.";
+static char url [] = "For info, please visit http://www.isc.org/dhcp-contrib.html";
-static void usage PROTO ((void));
+static void usage PROTO ((char *));
int main (argc, argv, envp)
int argc;
@@ -107,12 +107,20 @@ int main (argc, argv, envp)
struct interface_info *ip;
int seed;
int quiet = 0;
+ char *s;
+ s = strchr (argv [0], '/');
+ if (!s)
+ s = argv [0];
+ else
+ s++;
+
+ /* Initially, log errors to stderr as well as to syslogd. */
#ifdef SYSLOG_4_2
- openlog ("dhclient", LOG_NDELAY);
- log_priority = LOG_DAEMON;
+ openlog (s, LOG_NDELAY);
+ log_priority = DHCPD_LOG_FACILITY;
#else
- openlog ("dhclient", LOG_NDELAY, LOG_DAEMON);
+ openlog (s, LOG_NDELAY, DHCPD_LOG_FACILITY);
#endif
#if !(defined (DEBUG) || defined (SYSLOG_4_2) || defined (__CYGWIN32__))
@@ -122,7 +130,7 @@ int main (argc, argv, envp)
for (i = 1; i < argc; i++) {
if (!strcmp (argv [i], "-p")) {
if (++i == argc)
- usage ();
+ usage (s);
local_port = htons (atoi (argv [i]));
debug ("binding to user-specified port %d",
ntohs (local_port));
@@ -130,15 +138,19 @@ int main (argc, argv, envp)
no_daemon = 1;
} else if (!strcmp (argv [i], "-D")) {
save_scripts = 1;
+ } else if (!strcmp (argv [i], "-pf")) {
+ if (++i == argc)
+ usage (s);
+ path_dhclient_pid = argv [i];
} else if (!strcmp (argv [i], "-lf")) {
if (++i == argc)
- usage ();
+ usage (s);
path_dhclient_db = argv [i];
} else if (!strcmp (argv [i], "-q")) {
quiet = 1;
quiet_interface_discovery = 1;
} else if (argv [i][0] == '-') {
- usage ();
+ usage (s);
} else {
struct interface_info *tmp =
((struct interface_info *)
@@ -159,8 +171,10 @@ int main (argc, argv, envp)
note (message);
note (copyright);
note (arr);
+ note ("");
note (contrib);
note (url);
+ note ("");
}
/* Default to the DHCP/BOOTP port. */
@@ -266,9 +280,19 @@ int main (argc, argv, envp)
return 0;
}
-static void usage ()
+static void usage (appname)
+ char *appname;
{
- error ("Usage: dhclient [-c] [-p <port>] [-lf lease-file] [interface]");
+ note (message);
+ note (copyright);
+ note (arr);
+ note ("");
+ note (contrib);
+ note (url);
+ note ("");
+
+ warn ("Usage: %s [-c] [-p <port>] [-lf lease-file]", appname);
+ error (" [-pf pidfile] [interface]");
}
void cleanup ()
@@ -460,7 +484,6 @@ void dhcpack (packet)
{
struct interface_info *ip = packet -> interface;
struct client_lease *lease;
- int i;
/* If we're not receptive to an offer right now, or if the offer
has an unrecognizable transaction id, then just drop it. */
@@ -469,7 +492,9 @@ void dhcpack (packet)
packet -> raw -> hlen) ||
(memcmp (packet -> interface -> hw_address.haddr,
packet -> raw -> chaddr, packet -> raw -> hlen))) {
+#if defined (DEBUG)
debug ("DHCPACK in wrong transaction.");
+#endif
return;
}
@@ -477,7 +502,9 @@ void dhcpack (packet)
ip -> client -> state != S_REQUESTING &&
ip -> client -> state != S_RENEWING &&
ip -> client -> state != S_REBINDING) {
+#if defined (DEBUG)
debug ("DHCPACK in wrong state.");
+#endif
return;
}
@@ -700,7 +727,6 @@ void dhcpoffer (packet)
int arp_timeout_needed, stop_selecting;
char *name = (packet -> options [DHO_DHCP_MESSAGE_TYPE].len
? "DHCPOFFER" : "BOOTREPLY");
- struct iaddrlist *ap;
#ifdef DEBUG_PACKET
dump_packet (packet);
@@ -714,7 +740,9 @@ void dhcpoffer (packet)
packet -> raw -> hlen) ||
(memcmp (packet -> interface -> hw_address.haddr,
packet -> raw -> chaddr, packet -> raw -> hlen))) {
+#if defined (DEBUG)
debug ("%s in wrong transaction.", name);
+#endif
return;
}
@@ -917,7 +945,9 @@ void dhcpnak (packet)
packet -> raw -> hlen) ||
(memcmp (packet -> interface -> hw_address.haddr,
packet -> raw -> chaddr, packet -> raw -> hlen))) {
+#if defined (DEBUG)
debug ("DHCPNAK in wrong transaction.");
+#endif
return;
}
@@ -925,7 +955,9 @@ void dhcpnak (packet)
ip -> client -> state != S_REQUESTING &&
ip -> client -> state != S_RENEWING &&
ip -> client -> state != S_REBINDING) {
+#if defined (DEBUG)
debug ("DHCPNAK in wrong state.");
+#endif
return;
}
@@ -1033,10 +1065,11 @@ void send_discover (ipp)
ip -> client -> config -> timeout) - cur_time + 1;
/* Record the number of seconds since we started sending. */
- if (interval < 255)
- ip -> client -> packet.secs = interval;
+ if (interval < 65536)
+ ip -> client -> packet.secs = htons (interval);
else
- ip -> client -> packet.secs = 255;
+ ip -> client -> packet.secs = htons (65535);
+ ip -> client -> secs = ip -> client -> packet.secs;
note ("DHCPDISCOVER on %s to %s port %d interval %ld",
ip -> name,
@@ -1276,10 +1309,14 @@ void send_request (ipp)
from.s_addr = INADDR_ANY;
/* Record the number of seconds since we started sending. */
- if (interval < 255)
- ip -> client -> packet.secs = interval;
- else
- ip -> client -> packet.secs = 255;
+ if (ip -> client -> state == S_REQUESTING)
+ ip -> client -> packet.secs = ip -> client -> secs;
+ else {
+ if (interval < 65536)
+ ip -> client -> packet.secs = htons (interval);
+ else
+ ip -> client -> packet.secs = htons (65535);
+ }
note ("DHCPREQUEST on %s to %s port %d", ip -> name,
inet_ntoa (destination.sin_addr),
@@ -1347,7 +1384,6 @@ void make_discover (ip, lease)
struct interface_info *ip;
struct client_lease *lease;
{
- struct dhcp_packet *raw;
unsigned char discover = DHCPDISCOVER;
int i;
@@ -1409,8 +1445,8 @@ void make_discover (ip, lease)
/* Set up the option buffer... */
ip -> client -> packet_length =
- cons_options ((struct packet *)0, &ip -> client -> packet,
- options, 0, 0, 0);
+ cons_options ((struct packet *)0, &ip -> client -> packet, 0,
+ options, 0, 0, 0, (u_int8_t *)0, 0);
if (ip -> client -> packet_length < BOOTP_MIN_LEN)
ip -> client -> packet_length = BOOTP_MIN_LEN;
@@ -1420,7 +1456,12 @@ void make_discover (ip, lease)
ip -> client -> packet.hops = 0;
ip -> client -> packet.xid = random ();
ip -> client -> packet.secs = 0; /* filled in by send_discover. */
- ip -> client -> packet.flags = htons (BOOTP_BROADCAST); /* XXX */
+
+ if (can_receive_unicast_unconfigured (ip))
+ ip -> client -> packet.flags = 0;
+ else
+ ip -> client -> packet.flags = htons (BOOTP_BROADCAST);
+
memset (&(ip -> client -> packet.ciaddr),
0, sizeof ip -> client -> packet.ciaddr);
memset (&(ip -> client -> packet.yiaddr),
@@ -1516,8 +1557,8 @@ void make_request (ip, lease)
/* Set up the option buffer... */
ip -> client -> packet_length =
- cons_options ((struct packet *)0, &ip -> client -> packet,
- options, 0, 0, 0);
+ cons_options ((struct packet *)0, &ip -> client -> packet, 0,
+ options, 0, 0, 0, (u_int8_t *)0, 0);
if (ip -> client -> packet_length < BOOTP_MIN_LEN)
ip -> client -> packet_length = BOOTP_MIN_LEN;
@@ -1539,7 +1580,10 @@ void make_request (ip, lease)
} else {
memset (&ip -> client -> packet.ciaddr, 0,
sizeof ip -> client -> packet.ciaddr);
- ip -> client -> packet.flags = htons (BOOTP_BROADCAST);
+ if (can_receive_unicast_unconfigured (ip))
+ ip -> client -> packet.flags = 0;
+ else
+ ip -> client -> packet.flags = htons (BOOTP_BROADCAST);
}
memset (&ip -> client -> packet.yiaddr, 0,
@@ -1617,8 +1661,8 @@ void make_decline (ip, lease)
/* Set up the option buffer... */
ip -> client -> packet_length =
- cons_options ((struct packet *)0, &ip -> client -> packet,
- options, 0, 0, 0);
+ cons_options ((struct packet *)0, &ip -> client -> packet, 0,
+ options, 0, 0, 0, (u_int8_t *)0, 0);
if (ip -> client -> packet_length < BOOTP_MIN_LEN)
ip -> client -> packet_length = BOOTP_MIN_LEN;
@@ -1628,7 +1672,7 @@ void make_decline (ip, lease)
ip -> client -> packet.hops = 0;
ip -> client -> packet.xid = ip -> client -> xid;
ip -> client -> packet.secs = 0; /* Filled in by send_request. */
- ip -> client -> packet.flags = htons (BOOTP_BROADCAST);
+ ip -> client -> packet.flags = 0;
/* ciaddr must always be zero. */
memset (&ip -> client -> packet.ciaddr, 0,
@@ -1657,7 +1701,6 @@ void make_release (ip, lease)
struct tree_cache *options [256];
struct tree_cache message_type_tree;
- struct tree_cache requested_address_tree;
struct tree_cache server_id_tree;
memset (options, 0, sizeof options);
@@ -1683,8 +1726,8 @@ void make_release (ip, lease)
/* Set up the option buffer... */
ip -> client -> packet_length =
- cons_options ((struct packet *)0, &ip -> client -> packet,
- options, 0, 0, 0);
+ cons_options ((struct packet *)0, &ip -> client -> packet, 0,
+ options, 0, 0, 0, (u_int8_t *)0, 0);
if (ip -> client -> packet_length < BOOTP_MIN_LEN)
ip -> client -> packet_length = BOOTP_MIN_LEN;
@@ -1695,8 +1738,9 @@ void make_release (ip, lease)
ip -> client -> packet.xid = random ();
ip -> client -> packet.secs = 0;
ip -> client -> packet.flags = 0;
- memcpy (&ip -> client -> packet.ciaddr,
- lease -> address.iabuf, lease -> address.len);
+
+ memset (&ip -> client -> packet.ciaddr, 0,
+ sizeof ip -> client -> packet.ciaddr);
memset (&ip -> client -> packet.yiaddr, 0,
sizeof ip -> client -> packet.yiaddr);
memset (&ip -> client -> packet.siaddr, 0,
@@ -1992,20 +2036,19 @@ void script_write_params (ip, prefix, lease)
lease -> options [i].len);
if (len > sizeof dbuf) {
warn ("no space to %s %s",
- "prepend option",
+ "append option",
dhcp_options [i].name);
goto supersede;
}
dp = dbuf;
memcpy (dp,
+ lease -> options [i].data,
+ lease -> options [i].len);
+ memcpy (dp + lease -> options [i].len,
ip -> client ->
config -> defaults [i].data,
ip -> client ->
config -> defaults [i].len);
- memcpy (dp + ip -> client ->
- config -> defaults [i].len,
- lease -> options [i].data,
- lease -> options [i].len);
}
} else {
dp = ip -> client ->
diff --git a/contrib/isc-dhcp/client/dhclient.conf.5 b/contrib/isc-dhcp/client/dhclient.conf.5
index c5af648cf912..691908193e00 100644
--- a/contrib/isc-dhcp/client/dhclient.conf.5
+++ b/contrib/isc-dhcp/client/dhclient.conf.5
@@ -259,14 +259,15 @@ statement.
\fBprepend { [ \fIoption declaration\fR ]
[\fB,\fI ... \fIoption declaration\fR ]\fB}\fR
.PP
-If for some set of options the client should first a value it
-supplies, and then use the values supplied by
+If for some set of options the client should use a value you
+supply, and then use the values supplied by
the server, if any, these values can be defined in the
.B prepend
statement. The
.B prepend
statement can only be used for options which
-allow more than one value to be given.
+allow more than one value to be given. This restriction is not
+enforced - if violated, the results are unpredictable.
.PP
.I The
.B append
@@ -275,14 +276,15 @@ allow more than one value to be given.
\fBappend { [ \fIoption declaration\fR ]
[\fB,\fI ... \fIoption declaration\fR ]\fB}\fR
.PP
-If for some set of options the client should first a value it
-supplies, and then use the values supplied by
-the server, if any, these values can be defined in the
+If for some set of options the client should first use the values
+supplied by the server, if any, and then use values you supply, these
+values can be defined in the
.B append
statement. The
.B append
statement can only be used for options which
-allow more than one value to be given.
+allow more than one value to be given. This restriction is not
+enforced - if you ignore it, the behaviour will be unpredictable.
.SH LEASE DECLARATIONS
.PP
.I The
diff --git a/contrib/isc-dhcp/client/scripts/freebsd b/contrib/isc-dhcp/client/scripts/freebsd
index 77fdc5c9f26e..d9e44b40d088 100755
--- a/contrib/isc-dhcp/client/scripts/freebsd
+++ b/contrib/isc-dhcp/client/scripts/freebsd
@@ -1,5 +1,33 @@
#!/bin/sh
+make_resolv_conf() {
+ echo search $new_domain_name >/etc/resolv.conf
+ for nameserver in $new_domain_name_servers; do
+ echo nameserver $nameserver >>/etc/resolv.conf
+ done
+}
+
+# Must be used on exit. Invokes the local dhcp client exit hooks, if any.
+exit_with_hooks() {
+ exit_status=$1
+ if [ -x /etc/dhclient-exit-hooks ]; then
+ . /etc/dhclient-exit-hooks
+ fi
+# probably should do something with exit status of the local script
+ exit $exit_status
+}
+
+# Invoke the local dhcp client enter hooks, if they exist.
+if [ -x /etc/dhclient-enter-hooks ]; then
+ exit_status=0
+ . /etc/dhclient-enter-hooks
+ # allow the local script to abort processing of this state
+ # local script must set exit_status variable to nonzero.
+ if [ $exit_status -ne 0 ]; then
+ exit $exit_status
+ fi
+fi
+
if [ x$new_network_number != x ]; then
echo New Network Number: $new_network_number
fi
@@ -25,7 +53,7 @@ if [ x$reason = xMEDIUM ]; then
ifconfig $interface $medium
ifconfig $interface inet -alias 0.0.0.0 $medium >/dev/null 2>&1
sleep 1
- exit 0
+ exit_with_hooks 0
fi
if [ x$reason = xPREINIT ]; then
@@ -35,11 +63,11 @@ if [ x$reason = xPREINIT ]; then
fi
ifconfig $interface inet 0.0.0.0 netmask 0.0.0.0 \
broadcast 255.255.255.255 up
- exit 0
+ exit_with_hooks 0
fi
if [ x$reason = xARPCHECK ] || [ x$reason = xARPSEND ]; then
- exit 0;
+ exit_with_hooks 0;
fi
if [ x$reason = xBOUND ] || [ x$reason = xRENEW ] || \
@@ -89,7 +117,7 @@ if [ x$reason = xBOUND ] || [ x$reason = xRENEW ] || \
for nameserver in $new_domain_name_servers; do
echo nameserver $nameserver >>/etc/resolv.conf
done
- exit 0
+ exit_with_hooks 0
fi
if [ x$reason = xEXPIRE ] || [ x$reason = xFAIL ]; then
@@ -117,7 +145,7 @@ if [ x$reason = xEXPIRE ] || [ x$reason = xFAIL ]; then
ifconfig $interface inet alias $alias_ip_address $alias_subnet_arg
route add $alias_ip_address 127.0.0.1
fi
- exit 0
+ exit_with_hooks 0
fi
if [ x$reason = xTIMEOUT ]; then
@@ -153,7 +181,7 @@ if [ x$reason = xTIMEOUT ]; then
rm -f /etc/resolv.conf
fi
mv /etc/resolv.conf.std /etc/resolv.conf
- exit 0
+ exit_with_hooks 0
fi
fi
ifconfig $interface inet -alias $new_ip_address $medium
@@ -169,7 +197,7 @@ if [ x$reason = xTIMEOUT ]; then
fi
arp -n -a | sed -n -e 's/^.*(\(.*\)) at .*$/arp -n -d \1/p' \
|sh >/dev/null 2>&1
- exit 1
+ exit_with_hooks 1
fi
-exit 0
+exit_with_hooks 0