Blob Blame History Raw
From 95e8b165a7cf8a9f72ccfbc3ca09833c8e2cdb60 Mon Sep 17 00:00:00 2001
From: Lubomir Rintel <lkundrak@v3.sk>
Date: Thu, 8 Oct 2015 14:55:36 +0200
Subject: [PATCH] systemd,dhcpv6: clean up the lease on client reset

Upstream systemd.git commit 4e3e667 [sd-dhcp6-client: Fix unreferencing
DHCPv6 lease on client reset].

Fixed on master already.

https://bugzilla.redhat.com/show_bug.cgi?id=1260727
---
 .../systemd-dhcp/src/libsystemd-network/sd-dhcp6-client.c            | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/dhcp-manager/systemd-dhcp/src/libsystemd-network/sd-dhcp6-client.c b/src/dhcp-manager/systemd-dhcp/src/libsystemd-network/sd-dhcp6-client.c
index 8a17a72..6754fe1 100644
--- a/src/dhcp-manager/systemd-dhcp/src/libsystemd-network/sd-dhcp6-client.c
+++ b/src/dhcp-manager/systemd-dhcp/src/libsystemd-network/sd-dhcp6-client.c
@@ -285,6 +285,11 @@ static void client_notify(sd_dhcp6_client *client, int event) {
 static int client_reset(sd_dhcp6_client *client) {
         assert_return(client, -EINVAL);
 
+	if (client->lease) {
+		dhcp6_lease_clear_timers(&client->lease->ia);
+		client->lease = sd_dhcp6_lease_unref(client->lease);
+	}
+
         client->receive_message =
                 sd_event_source_unref(client->receive_message);
 
-- 
2.4.3