aboutsummaryrefslogtreecommitdiff
path: root/sbin/dhclient/options.c
diff options
context:
space:
mode:
authorNick Hibma <n_hibma@FreeBSD.org>2017-05-07 21:11:28 +0000
committerNick Hibma <n_hibma@FreeBSD.org>2017-05-07 21:11:28 +0000
commitcfbb427c9d30023341f932cdf3f0a9346f3a8550 (patch)
treea41f716388fed7fee41c287ece95b57c319d394f /sbin/dhclient/options.c
parent223c44aec904ff8a84ed55f256b3c359e403e0ae (diff)
downloadsrc-cfbb427c9d30023341f932cdf3f0a9346f3a8550.tar.gz
src-cfbb427c9d30023341f932cdf3f0a9346f3a8550.zip
Fix the output of very large rebind, renew and lease time options in
lease file. Some routers set very large values for rebind time (Netgear) and these are erroneously reported as negative in the leasefile. This was due to a wrong printf format specification of %ld for an unsigned long on 32-bit platforms.
Notes
Notes: svn path=/head/; revision=317923
Diffstat (limited to 'sbin/dhclient/options.c')
-rw-r--r--sbin/dhclient/options.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sbin/dhclient/options.c b/sbin/dhclient/options.c
index be073dae39cd..fe025e6d6a40 100644
--- a/sbin/dhclient/options.c
+++ b/sbin/dhclient/options.c
@@ -783,7 +783,7 @@ pretty_print_option(unsigned int code, unsigned char *data, int len,
dp += 4;
break;
case 'L':
- opcount = snprintf(op, opleft, "%ld",
+ opcount = snprintf(op, opleft, "%lu",
(unsigned long)getULong(dp));
if (opcount >= opleft || opcount == -1)
goto toobig;
@@ -799,7 +799,7 @@ pretty_print_option(unsigned int code, unsigned char *data, int len,
dp += 2;
break;
case 'S':
- opcount = snprintf(op, opleft, "%d",
+ opcount = snprintf(op, opleft, "%u",
getUShort(dp));
if (opcount >= opleft || opcount == -1)
goto toobig;