From 7bf2f4397255bc8f6cf20a0f2adab4c984ea7d14 Mon Sep 17 00:00:00 2001 From: Tom Gundersen Date: Wed, 19 Mar 2014 10:41:29 +0100 Subject: sd-dhcp-client: accept infinite lease lifetime Otherwise we would fail with -EINVAL. Thanks to Brandon Philips , for reporting the bug. --- src/libsystemd-network/sd-dhcp-client.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src') 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; -- cgit v1.2.3-54-g00ecf