1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-07 01:27:11 +03:00

sd-dhcp-client: accept infinite lease lifetime

Otherwise we would fail with -EINVAL. Thanks to Brandon Philips
<brandon.philips@coreos.com>, for reporting the bug.
This commit is contained in:
Tom Gundersen 2014-03-19 10:41:29 +01:00
parent 8b1243f72e
commit 7bf2f43972

View File

@ -747,6 +747,10 @@ static int client_set_lease_timeouts(sd_dhcp_client *client, uint64_t usec) {
assert(client);
assert(client->event);
/* don't set timers for infinite leases */
if (client->lease->lifetime == 0xffffffff)
return 0;
if (client->lease->lifetime < 10)
return -EINVAL;