From ae6dc22b40fe6de7cd3d643b492e5459265d6714 Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Sat, 12 Sep 2026 08:53:46 +0900 Subject: [PATCH] network: disable IPv4ACD when the address request is cancelled If an address with IPv4ACD is requested, then sd_ipv4acd instance for the address is configured. If the request is cancelled, we should also disable the IPv4ACD instance. Note, if the address is already configured, the IPv4ACD instance for the address will be removed when the address is removed. See address_drop(). (cherry picked from commit c5bf6bac23046c061c07164fe1bd016068728129) --- src/network/networkd-address.c | 3 +++ src/network/networkd-link.c | 8 ++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/network/networkd-address.c b/src/network/networkd-address.c index 582069cf39..888ecdf260 100644 --- a/src/network/networkd-address.c +++ b/src/network/networkd-address.c @@ -1335,6 +1335,9 @@ int address_remove_and_cancel(Address *address, Link *link) { if (waiting || (address->link && address_exists(address))) return address_remove(address, link); + /* Otherwise, the address should be already gone or not configured yet. */ + ipv4acd_detach(link, address); + return 0; } diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c index fc61c3818e..64d1f1f6fe 100644 --- a/src/network/networkd-link.c +++ b/src/network/networkd-link.c @@ -1095,8 +1095,12 @@ int link_drop_requests(Link *link, NetworkConfigSource source) { if (source >= 0 && address->source != source) continue; - if (remove && address_get(link, address, /* ret= */ NULL) < 0) - RET_GATHER(ret, address_remove(address, link)); + if (address_get(link, address, /* ret= */ NULL) < 0) { + if (remove) + RET_GATHER(ret, address_remove(address, link)); + else + ipv4acd_detach(link, address); + } break; } case REQUEST_TYPE_NEIGHBOR: {