summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShawn Routhier <sar@isc.org>2014-05-19 13:30:50 -0700
committerShawn Routhier <sar@isc.org>2014-05-19 13:30:50 -0700
commite43a8f47a0da322cbcbc5a0472d3b278f279edba (patch)
tree8886591614752b9c1cce69bb5f81cf43b227b57b
parent4add6c6d5c60d1a41c40c11810bb7fdea1a5983d (diff)
downloadisc-dhcp-e43a8f47a0da322cbcbc5a0472d3b278f279edba.tar.gz
[v4_2] When writing a client lease file use the fsync call
-rw-r--r--RELNOTES5
-rw-r--r--client/dhclient.c2
2 files changed, 6 insertions, 1 deletions
diff --git a/RELNOTES b/RELNOTES
index 53a3a161..7bc3c1f0 100644
--- a/RELNOTES
+++ b/RELNOTES
@@ -119,6 +119,11 @@ by Eric Young (eay@cryptsoft.com).
By default it is set to 64. While 128 might be a better choice it would
also be a change for currently running systems, so we have left it at 64.
[ISC-Bugs #DHCP-2]
+
+- Have the client fsync the lease file to avoid lease corruption if the
+ client hibernates or otherwise shuts down.
+ [ISC-Bugs #35894]
+
Changes since 4.2.6rc1
- None
diff --git a/client/dhclient.c b/client/dhclient.c
index c0f42959..657737e6 100644
--- a/client/dhclient.c
+++ b/client/dhclient.c
@@ -1245,7 +1245,7 @@ void bind_lease (client)
/* Write out the new lease if it has been long enough. */
if (!client->last_write ||
(cur_time - client->last_write) >= MIN_LEASE_WRITE)
- write_client_lease(client, client->new, 0, 0);
+ write_client_lease(client, client->new, 0, 1);
/* Replace the old active lease with the new one. */
if (client->active)