From 56cd007ab83749b85670c9c7f560e083980c2ff4 Mon Sep 17 00:00:00 2001 From: Patrik Flykt Date: Wed, 9 Apr 2014 13:12:09 +0300 Subject: sd-ipv4ll: Add reference counting for IPv4LL Similar to DHCP, the IPv4LL library user can decide to free the LL client any time the callback is called. Guard against freeing the LL client in the callback by introducing proper reference counting. Also update code using the IPv4LL library to properly handle a returned NULL from the notify and stop functions if the IPv4LL client was freed. --- src/network/networkd-link.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/network/networkd-link.c') diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c index 2630b4625a..684e1e5d3d 100644 --- a/src/network/networkd-link.c +++ b/src/network/networkd-link.c @@ -83,7 +83,7 @@ void link_free(Link *link) { sd_dhcp_client_unref(link->dhcp_client); sd_dhcp_lease_unref(link->dhcp_lease); - sd_ipv4ll_free(link->ipv4ll); + sd_ipv4ll_unref(link->ipv4ll); hashmap_remove(link->manager->links, &link->ifindex); -- cgit v1.2.3-54-g00ecf