From ea05c46298419c37b91dd65eb5064db0538510ac Mon Sep 17 00:00:00 2001 From: Jiri Popelka Date: Sep 04 2014 14:22:34 +0000 Subject: [dhclient -6] infinite preferred/valid lifetime represented as -1 (#1133839) --- diff --git a/dhcp-dhc6-life.patch b/dhcp-dhc6-life.patch new file mode 100644 index 0000000..49b3a5b --- /dev/null +++ b/dhcp-dhc6-life.patch @@ -0,0 +1,37 @@ +From 4d5514f9579197a4200a52332a9047da1424b3ee Mon Sep 17 00:00:00 2001 +From: Jiri Popelka +Date: Thu, 4 Sep 2014 16:03:38 +0200 +Subject: [PATCH] [dhclient -6] fix lease time exporting + +addr->preferred_life and addr->max_life are u_int32_t +so casting them to (int) causes problems with big values, +for example with 'infinity' (0xffffffff), which is +then represented as '-1' in dhclient-script. + +Signed-off-by: Jiri Popelka +--- + client/dhc6.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/client/dhc6.c b/client/dhc6.c +index c724b58..04a8fa0 100644 +--- a/client/dhc6.c ++++ b/client/dhc6.c +@@ -3862,10 +3862,10 @@ dhc6_marshall_values(const char *prefix, struct client_state *client, + } + client_envadd(client, prefix, "life_starts", "%d", + (int)(addr->starts)); +- client_envadd(client, prefix, "preferred_life", "%d", +- (int)(addr->preferred_life)); +- client_envadd(client, prefix, "max_life", "%d", +- (int)(addr->max_life)); ++ client_envadd(client, prefix, "preferred_life", "%u", ++ addr->preferred_life); ++ client_envadd(client, prefix, "max_life", "%u", ++ addr->max_life); + } + + /* ia fields. */ +-- +2.1.0 + diff --git a/dhcp.spec b/dhcp.spec index 2320edd..bae25a9 100644 --- a/dhcp.spec +++ b/dhcp.spec @@ -18,7 +18,7 @@ Summary: Dynamic host configuration protocol software Name: dhcp Version: 4.2.7 -Release: 3%{?dist} +Release: 4%{?dist} # NEVER CHANGE THE EPOCH on this package. The previous maintainer (prior to # dcantrell maintaining the package) made incorrect use of the epoch and # that's why it is at 12 now. It should have never been used, but it was. @@ -66,7 +66,7 @@ Patch33: dhcp-4.2.6-lpf-ib.patch Patch34: dhcp-4.2.4-improved-xid.patch Patch35: dhcp-4.2.2-gpxe-cid.patch Patch36: dhcp-4.2.6-systemtap.patch - +Patch37: dhcp-dhc6-life.patch Patch38: dhcp-4.2.3-P2-log_perror.patch Patch39: dhcp-4.2.4-getifaddrs.patch Patch40: dhcp-4.2.5-omapi-leak.patch @@ -282,6 +282,9 @@ rm -rf includes/isc-dhcp # http://sourceware.org/systemtap/wiki/SystemTap %patch36 -p1 -b .systemtap +# (Submitted to dhcp-bugs@isc.org - [ISC-Bugs #37084]) +%patch37 -p1 -b .life + # Don't send log messages to the standard error descriptor by default (#790387) # (Submitted to dhcp-bugs@isc.org - [ISC-Bugs #28049]) %patch38 -p1 -b .log_perror @@ -598,6 +601,9 @@ done %changelog +* Thu Sep 04 2014 Jiri Popelka - 12:4.2.7-4 +- [dhclient -6] infinite preferred/valid lifetime represented as -1 (#1133839) + * Mon Aug 25 2014 Jiri Popelka - 12:4.2.7-3 - spec: use -D with 'install' - dhclient-script: IPv6 address which fails DAD is auto-removed when it was