chiark / gitweb /
sd-dhcp-client: accept infinite lease lifetime
authorTom Gundersen <teg@jklm.no>
Wed, 19 Mar 2014 09:41:29 +0000 (10:41 +0100)
committerTom Gundersen <teg@jklm.no>
Wed, 19 Mar 2014 09:41:29 +0000 (10:41 +0100)
Otherwise we would fail with -EINVAL. Thanks to Brandon Philips
<brandon.philips@coreos.com>, for reporting the bug.

src/libsystemd-network/sd-dhcp-client.c

index 8411141..ce375dd 100644 (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;