]> git.ipfire.org Git - thirdparty/dhcp.git/commitdiff
[v4_1_esv] Added conditional comp flag, CALL_SCRIPT_ON_ONETRY_FAIL
authortmarkwalder <tmark@isc.org>
Wed, 28 Jun 2017 18:04:06 +0000 (14:04 -0400)
committertmarkwalder <tmark@isc.org>
Wed, 28 Jun 2017 18:04:06 +0000 (14:04 -0400)
    Merges in rt18183a.

RELNOTES
client/dhclient.c
includes/site.h

index fbe9e0f7483822166fd3290a57e1004b4e0eb320..9cdfacebfaeb12fafca6e3d9ceb4c0f283a82675 100644 (file)
--- a/RELNOTES
+++ b/RELNOTES
@@ -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
index efec331002a21c6a75cd0662e86c2e5f2eb76f1c..590fe8da4ba77bd7acac6794e6125e4f2ecf7f78 100644 (file)
@@ -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);
        }
 
index b467d01354f6af5f0f1a2edb18319b528253c12f..693ec1c3207cb029ae43184863564c5fda9ad1de 100644 (file)
  * 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 */