]> git.ipfire.org Git - thirdparty/dhcp.git/commitdiff
[master] When writing a client lease file use the fsync call
authorShawn Routhier <sar@isc.org>
Mon, 19 May 2014 20:22:03 +0000 (13:22 -0700)
committerShawn Routhier <sar@isc.org>
Mon, 19 May 2014 20:22:03 +0000 (13:22 -0700)
RELNOTES
client/dhclient.c

index fa6172da4dd3586338e058ae7150001531ff5a27..ce66eec23b88ea396b1e175ea59221dc47fffd27 100644 (file)
--- a/RELNOTES
+++ b/RELNOTES
@@ -152,6 +152,10 @@ by Eric Young (eay@cryptsoft.com).
   lease file and the DUID will be written out to the main lease file.
   [ISC-Bugs #34886]
 
+- 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.3.0rc1
 
 - None
index cd82070dd0491fadd620666250916d53f64ef813..6d348c1ef0889dfd183bec90867a38688f2af4fa 100644 (file)
@@ -1271,7 +1271,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)