chiark / gitweb /
sd-dhcp-client: Add reference counting for DHCP
authorPatrik Flykt <patrik.flykt@linux.intel.com>
Wed, 9 Apr 2014 10:12:07 +0000 (13:12 +0300)
committerPatrik Flykt <patrik.flykt@linux.intel.com>
Fri, 11 Apr 2014 07:53:10 +0000 (10:53 +0300)
commite5b04c8de83aa17e324bae95f18a822931fb8078
treeeee925e6853fb7befcab251bf640e8dfe4a9e360
parent48a4612e6b67ae81b93ee8e8a4b3f8efa5324270
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.
src/libsystemd-network/sd-dhcp-client.c
src/libsystemd-network/test-dhcp-client.c
src/network/networkd-link.c
src/systemd/sd-dhcp-client.h