summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Gundersen <teg@jklm.no>2014-03-19 10:41:29 +0100
committerTom Gundersen <teg@jklm.no>2014-03-19 10:41:29 +0100
commit7bf2f4397255bc8f6cf20a0f2adab4c984ea7d14 (patch)
treebf1733f39261e5f6875a1aea2ff40ba40d565742
parent8b1243f72ed321bd11f0939405b6d0963ce5eea5 (diff)
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.
-rw-r--r--src/libsystemd-network/sd-dhcp-client.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/libsystemd-network/sd-dhcp-client.c b/src/libsystemd-network/sd-dhcp-client.c
index 84111412d1..ce375dd016 100644
--- a/src/libsystemd-network/sd-dhcp-client.c
+++ b/src/libsystemd-network/sd-dhcp-client.c
@@ -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;