summaryrefslogtreecommitdiff
path: root/src/network
diff options
context:
space:
mode:
authorPatrik Flykt <patrik.flykt@linux.intel.com>2014-04-09 13:12:07 +0300
committerPatrik Flykt <patrik.flykt@linux.intel.com>2014-04-11 10:53:10 +0300
commite5b04c8de83aa17e324bae95f18a822931fb8078 (patch)
treeeee925e6853fb7befcab251bf640e8dfe4a9e360 /src/network
parent48a4612e6b67ae81b93ee8e8a4b3f8efa5324270 (diff)
sd-dhcp-client: Add reference counting for DHCP
The DHCP library user can decide to free the DHCP client any time the callback is called. After the callback has been called, other computations may still be needed - the best example being a full restart of the DHCP procedure in case of lease expiry. Fix this by introducing proper reference counting. Properly handle a returned NULL from the notify and stop functions if the DHCP client was freed.
Diffstat (limited to 'src/network')
-rw-r--r--src/network/networkd-link.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c
index f076525539..2630b4625a 100644
--- a/src/network/networkd-link.c
+++ b/src/network/networkd-link.c
@@ -80,7 +80,7 @@ void link_free(Link *link) {
assert(link->manager);
- sd_dhcp_client_free(link->dhcp_client);
+ sd_dhcp_client_unref(link->dhcp_client);
sd_dhcp_lease_unref(link->dhcp_lease);
sd_ipv4ll_free(link->ipv4ll);