From: Shawn Routhier Date: Mon, 19 May 2014 20:22:03 +0000 (-0700) Subject: [master] When writing a client lease file use the fsync call X-Git-Tag: v4_3_1b1~13 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8a2e40cff8aa99c00bd391e3d6928622d99a213e;p=thirdparty%2Fdhcp.git [master] When writing a client lease file use the fsync call --- diff --git a/RELNOTES b/RELNOTES index fa6172da4..ce66eec23 100644 --- 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 diff --git a/client/dhclient.c b/client/dhclient.c index cd82070dd..6d348c1ef 100644 --- a/client/dhclient.c +++ b/client/dhclient.c @@ -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)