diff options
author | tmarkwalder <tmark@isc.org> | 2017-06-28 14:04:06 -0400 |
---|---|---|
committer | tmarkwalder <tmark@isc.org> | 2017-06-28 14:04:06 -0400 |
commit | b0021d1ef6269ea81d052f8557d61d8030debe35 (patch) | |
tree | 8ee8e172fd6e78734cba1cf5950b678ee40016cf | |
parent | f0c62861b2e0f7605ae02884ed0d9b4d640389c1 (diff) | |
download | isc-dhcp-b0021d1ef6269ea81d052f8557d61d8030debe35.tar.gz |
[v4_1_esv] Added conditional comp flag, CALL_SCRIPT_ON_ONETRY_FAIL
Merges in rt18183a.
-rw-r--r-- | RELNOTES | 7 | ||||
-rw-r--r-- | client/dhclient.c | 12 | ||||
-rw-r--r-- | includes/site.h | 7 |
3 files changed, 18 insertions, 8 deletions
@@ -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] - The server now detects failover peers that are not referenced in at least diff --git a/client/dhclient.c b/client/dhclient.c index efec3310..590fe8da 100644 --- a/client/dhclient.c +++ b/client/dhclient.c @@ -1269,14 +1269,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 exit(2); } else { state_init(client); @@ -2084,14 +2086,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 exit (2); } diff --git a/includes/site.h b/includes/site.h index b467d013..693ec1c3 100644 --- a/includes/site.h +++ b/includes/site.h @@ -319,4 +319,9 @@ * offered leases that do not contain all options specified as required * in the client's configuration file. The client already enforces this * in -4 mode. */ -/*#define ENFORCE_DHCPV6_CLIENT_REQUIRE*/ +/* #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 */ |