philipp / rpms / dhcp

Forked from rpms/dhcp 4 years ago
Clone

Blame SOURCES/dhcp-dhc6-life.patch

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