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().
This commit is contained in:
Yu Watanabe
2026-09-23 13:39:40 +09:00
parent 4be31a9c35
commit c5bf6bac23
2 changed files with 9 additions and 2 deletions
+3
View File
@@ -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;
}
+6 -2
View File
@@ -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: {