summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortmarkwalder <tmark@isc.org>2017-06-28 13:25:22 -0400
committertmarkwalder <tmark@isc.org>2017-06-28 13:25:22 -0400
commit5c03ed373d91b116475fbbc00348a7082db6e14c (patch)
tree380a43d09b5a093122c8603aaded68be04831389
parent63ccfbb04553b64ad20dabb22a3055f6410bb890 (diff)
downloadisc-dhcp-5c03ed373d91b116475fbbc00348a7082db6e14c.tar.gz
[master] Added conditional comp flag, CALL_SCRIPT_ON_ONETRY_FAIL
Merges in rt18183a.
-rw-r--r--RELNOTES9
-rw-r--r--client/dhclient.c12
-rw-r--r--includes/site.h5
3 files changed, 18 insertions, 8 deletions
diff --git a/RELNOTES b/RELNOTES
index 656c156f..1926baf1 100644
--- a/RELNOTES
+++ b/RELNOTES
@@ -1,5 +1,5 @@
Internet Systems Consortium DHCP Distribution
- Version 4.4.0-pre-alpha
+ Version 4.4.0-dev
29 March 2016
Release Notes
@@ -164,9 +164,10 @@ by Eric Young (eay@cryptsoft.com).
to Pierre Clerissi for bringing this issue to our attention.
[ISC-Bugs #44373]
-- Client now calls the script with reason set to FAIL when run with -1
- (one try) and there are no server responses. Thanks for a patch by Martin
- Pitt which got to us via Andrew Pollock.
+- By defining CALL_SCRIPT_ON_ONETRY_FAIL in includes/site.h, dhclient will
+ now call the script with reason set to FAIL when run with -1 (one try) and
+ there are no server responses. This applies to IPv4 mode only. Thanks for a
+ patch by Martin Pitt which got to us via Andrew Pollock.
[ISC-bugs #18183]
- Linux script updated. The script is now based on Debian version. It uses
diff --git a/client/dhclient.c b/client/dhclient.c
index d20ef05d..84a86fb3 100644
--- a/client/dhclient.c
+++ b/client/dhclient.c
@@ -1479,14 +1479,16 @@ void bind_lease (client)
destroy_client_lease(client->new);
client->new = NULL;
if (onetry) {
- if (!quiet)
+ if (!quiet) {
log_info("Unable to obtain a lease on first "
"try (declined). Exiting.");
+ }
+#if defined (CALL_SCRIPT_ON_ONETRY_FAIL)
/* Let's call a script and we're done */
script_init(client, "FAIL", (struct string_list *)0);
script_go(client);
-
+#endif
finish(2);
} else {
state_init(client);
@@ -2493,14 +2495,16 @@ void state_panic (cpp)
tell the shell script that we failed to allocate an address,
and try again later. */
if (onetry) {
- if (!quiet)
+ if (!quiet) {
log_info ("Unable to obtain a lease on first try.%s",
" Exiting.");
+ }
+#if defined (CALL_SCRIPT_ON_ONETRY_FAIL)
/* Let's call a script and we're done */
script_init(client, "FAIL", (struct string_list *)0);
script_go(client);
-
+#endif
finish(2);
}
diff --git a/includes/site.h b/includes/site.h
index b2fb8efc..220d31a5 100644
--- a/includes/site.h
+++ b/includes/site.h
@@ -339,6 +339,11 @@
* in -4 mode. */
#define ENFORCE_DHCPV6_CLIENT_REQUIRE
+/* Enable the invocation of the client script with a FAIL state code
+ * by dhclient when running in one-try mode (-T) and the attempt to
+ * obtain the desired lease(s) fails. Applies to IPv4 mode only. */
+/* #define CALL_SCRIPT_ON_ONETRY_FAIL */
+
/* Include definitions for various options. In general these
should be left as is, but if you have already defined one
of these and prefer your definition you can comment the