]> git.ipfire.org Git - thirdparty/dhcp.git/commitdiff
[v4_1_esv] Corrected dhclient command line parsing of --dad-wait-time
authorThomas Markwalder <tmark@isc.org>
Thu, 20 Jun 2019 14:14:58 +0000 (10:14 -0400)
committerThomas Markwalder <tmark@isc.org>
Thu, 20 Jun 2019 14:14:58 +0000 (10:14 -0400)
    Merges in rt46535

RELNOTES
client/dhclient.c

index f063cf472842de08c7ee94bc127d2c42353edc7f..4eadf7674aeed0e4c3f7dfca05558647b4c03a79 100644 (file)
--- a/RELNOTES
+++ b/RELNOTES
@@ -72,6 +72,12 @@ We welcome comments from DHCP users, about this or anything else we do.
 Email Vicky Risk, Product Manager at vicky@isc.org or discuss on
 dhcp-users@lists.isc.org.
 
+                       Changes since 4.1-ESV-R15
+
+- Corrected dhclient command line parsing for --dad-wait-time that causes
+  even valid values to fail as invalid on some environments.
+  [ISC-Bugs #46535]
+
                        Changes since 4.1-ESV-R15b1
 
 - None
index 590fe8da4ba77bd7acac6794e6125e4f2ecf7f78..7d560d61d07778d7b4d50e680971e1b56e10db79 100644 (file)
@@ -359,9 +359,11 @@ main(int argc, char **argv) {
                        if (++i == argc) {
                                usage(use_noarg, argv[i-1]);
                        }
+                       errno = 0;
                        dad_wait_time = (int)strtol(argv[i], &s, 10);
                        if (errno || (*s != '\0') || (dad_wait_time < 0)) {
-                               usage("Invalid value for --dad-wait-time: %s", argv[i]);
+                               usage("Invalid value for --dad-wait-time: %s",
+                                     argv[i]);
                        }
 
 #endif /* DHCPv6 */