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