summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDaniel Mack <github@zonque.org>2015-08-04 08:42:25 +0200
committerDaniel Mack <github@zonque.org>2015-08-04 08:42:25 +0200
commit58a2e9acd8216f55b004e5432f76a851f7b233c0 (patch)
tree7b8c4b67283a424e111b125b66b7aa3d95445354 /src
parent195c9e37fcb1273b92e2cdacc1d0aa573bf7a92d (diff)
parentbff92d2c2f913c368d80066ee89855665818edc8 (diff)
Merge pull request #850 from ssahani/dhcp
networkd: DHCP fix CID 1315105
Diffstat (limited to 'src')
-rw-r--r--src/libsystemd-network/sd-dhcp-server.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/libsystemd-network/sd-dhcp-server.c b/src/libsystemd-network/sd-dhcp-server.c
index d2cc3194b3..a0af256dee 100644
--- a/src/libsystemd-network/sd-dhcp-server.c
+++ b/src/libsystemd-network/sd-dhcp-server.c
@@ -796,8 +796,12 @@ int dhcp_server_handle_message(sd_dhcp_server *server, DHCPMessage *message,
r = sd_event_now(server->event,
clock_boottime_or_monotonic(),
&time_now);
- if (r < 0)
+ if (r < 0) {
+ if (!existing_lease)
+ dhcp_lease_free(lease);
return r;
+ }
+
lease->expiration = req->lifetime * USEC_PER_SEC + time_now;
r = server_send_ack(server, req, address);