Blame SOURCES/dhcp-dhc6-life.patch

fad460
From 4d5514f9579197a4200a52332a9047da1424b3ee Mon Sep 17 00:00:00 2001
fad460
From: Jiri Popelka <jpopelka@redhat.com>
fad460
Date: Thu, 4 Sep 2014 16:03:38 +0200
fad460
Subject: [PATCH] [dhclient -6] fix lease time exporting
fad460
fad460
addr->preferred_life and addr->max_life are u_int32_t
fad460
so casting them to (int) causes problems with big values,
fad460
for example with 'infinity' (0xffffffff), which is
fad460
then represented as '-1' in dhclient-script.
fad460
fad460
Signed-off-by: Jiri Popelka <jpopelka@redhat.com>
fad460
---
fad460
 client/dhc6.c | 8 ++++----
fad460
 1 file changed, 4 insertions(+), 4 deletions(-)
fad460
fad460
diff --git a/client/dhc6.c b/client/dhc6.c
fad460
index c724b58..04a8fa0 100644
fad460
--- a/client/dhc6.c
fad460
+++ b/client/dhc6.c
fad460
@@ -3862,10 +3862,10 @@ dhc6_marshall_values(const char *prefix, struct client_state *client,
fad460
 		}
fad460
 		client_envadd(client, prefix, "life_starts", "%d",
fad460
 			      (int)(addr->starts));
fad460
-		client_envadd(client, prefix, "preferred_life", "%d",
fad460
-			      (int)(addr->preferred_life));
fad460
-		client_envadd(client, prefix, "max_life", "%d",
fad460
-			      (int)(addr->max_life));
fad460
+		client_envadd(client, prefix, "preferred_life", "%u",
fad460
+			      addr->preferred_life);
fad460
+		client_envadd(client, prefix, "max_life", "%u",
fad460
+			      addr->max_life);
fad460
 	}
fad460
 
fad460
 	/* ia fields. */
fad460
-- 
fad460
2.1.0
fad460