]> git.ipfire.org Git - thirdparty/systemd.git/commit - src/libsystemd-network/sd-dhcp6-client.c
sd-dhcp6-client: Fix DHCPv6 client file descriptor handling
authorPatrik Flykt <patrik.flykt@linux.intel.com>
Tue, 23 Jan 2018 10:34:31 +0000 (12:34 +0200)
committerLennart Poettering <lennart@poettering.net>
Tue, 23 Jan 2018 12:42:12 +0000 (13:42 +0100)
commit10a0f27bfdd22ec1fe7d9fc2af15c3a2bf221a97
treef43585f6debe944a6757a15221f23cadfe336800
parent2b0c59baa23c04475579def2ab3c7945eaf67b4f
sd-dhcp6-client: Fix DHCPv6 client file descriptor handling

The DHCPv6 client will set its state to DHCP6_STATE_STOPPED if
an error occurs or when receiving an Information Reply DHCPv6
message. Once in DHCP6_STATE_STOPPED, the DHCPv6 client needs
to be restarted by calling sd_dhcp6_client_start().

As of pull request #7796 client_reset() no longer closes the
network socket, thus a call to sd_dhcp6_client_start() needs to
check whether the file descriptor already exists in order not to
create a new one. Likewise, a call to sd_dhcp6_client_unref()
must now close the network socket as client_reset() is not
closing it.

Reported by asavah and Yu Watanabe.
src/libsystemd-network/sd-dhcp6-client.c