summaryrefslogtreecommitdiffstats
path: root/src/network/networkd-link.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/network/networkd-link.c')
-rw-r--r--src/network/networkd-link.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c
index 710de80fde..47761f2e15 100644
--- a/src/network/networkd-link.c
+++ b/src/network/networkd-link.c
@@ -774,6 +774,7 @@ static void link_enter_unmanaged(Link *link) {
int link_stop_clients(Link *link, bool may_keep_dhcp) {
int r = 0, k;
+ Address *ad;
assert(link);
assert(link->manager);
@@ -798,6 +799,14 @@ int link_stop_clients(Link *link, bool may_keep_dhcp) {
r = log_link_warning_errno(link, k, "Could not stop IPv4 link-local: %m");
}
+ if (link->network)
+ LIST_FOREACH(addresses, ad, link->network->static_addresses)
+ if (ad->acd && sd_ipv4acd_is_running(ad->acd) == 0) {
+ k = sd_ipv4acd_stop(ad->acd);
+ if (k < 0)
+ r = log_link_warning_errno(link, k, "Could not stop IPv4 ACD client: %m");
+ }
+
if (link->dhcp6_client) {
k = sd_dhcp6_client_stop(link->dhcp6_client);
if (k < 0)
@@ -2584,6 +2593,24 @@ static int link_drop_config(Link *link) {
return 0;
}
+static int link_configure_ipv4_dad(Link *link) {
+ Address *address;
+ int r;
+
+ assert(link);
+ assert(link->network);
+
+ LIST_FOREACH(addresses, address, link->network->static_addresses)
+ if (address->family == AF_INET &&
+ FLAGS_SET(address->duplicate_address_detection, ADDRESS_FAMILY_IPV4)) {
+ r = configure_ipv4_duplicate_address_detection(link, address);
+ if (r < 0)
+ return log_link_error_errno(link, r, "Failed to configure IPv4ACD: %m");
+ }
+
+ return 0;
+}
+
static int link_configure_qdiscs(Link *link) {
QDisc *qdisc;
Iterator i;
@@ -2732,6 +2759,10 @@ static int link_configure(Link *link) {
if (r < 0)
return r;
+ r = link_configure_ipv4_dad(link);
+ if (r < 0)
+ return r;
+
return link_configure_after_setting_mtu(link);
}