diff options
author | Patrik Flykt <patrik.flykt@linux.intel.com> | 2014-06-25 12:36:55 +0300 |
---|---|---|
committer | Patrik Flykt <patrik.flykt@linux.intel.com> | 2014-06-26 16:09:50 +0300 |
commit | 1873a3d344042e818d2a5762c0ebfc3823c8f84d (patch) | |
tree | 2beb78ee65a446934c579c155b76df1ffa0c5d9d /src | |
parent | 836cf0905c4a8fe3358d6b0e005192d5ee51d3e2 (diff) |
networkd: Properly stop router solicitation and DHCPv6 client
When a link fails or looses carrier, always stop ongoing router
solicitation and any DHCPv6 client that may be running.
Diffstat (limited to 'src')
-rw-r--r-- | src/network/networkd-link.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c index 44147b2c0d..9296a594db 100644 --- a/src/network/networkd-link.c +++ b/src/network/networkd-link.c @@ -236,11 +236,19 @@ static int link_stop_clients(Link *link) { } if (link->network->dhcp6) { - assert(link->dhcp6_client); + assert(link->icmp6_router_discovery); + + if (link->dhcp6_client) { + k = sd_dhcp6_client_stop(link->dhcp6_client); + if (k < 0) { + log_warning_link(link, "Could not stop DHCPv6 client: %s", strerror(-r)); + r = k; + } + } - k = sd_dhcp6_client_stop(link->dhcp6_client); + k = sd_icmp6_nd_stop(link->icmp6_router_discovery); if (k < 0) { - log_warning_link(link, "Could not stop DHCPv6 client: %s", strerror(-r)); + log_warning_link(link, "Could not stop ICMPv6 router discovery: %s", strerror(-r)); r = k; } } |