network: find pending address in IPv4 ACD callback

When IPv4 ACD is enabled for a DHCPv4 address, the address remains in
the request queue until ACD succeeds. Hence, when ACD detects a
conflict, the address may not be present in link->addresses yet.

on_acd() currently looks up the address with address_get(), which only
searches link->addresses. This makes the callback return early and
prevents dhcp4_address_on_conflict() from sending DHCPDECLINE.

Use address_get_harder(), which also looks up pending address requests.

Fixes #39460

(cherry picked from commit 2aed6d9ad7)
This commit is contained in:
Heran Yang
2026-10-16 11:36:32 +01:00
committed by Luca Boccassi
parent 64f2911bac
commit 9a4abe9909
+1 -1
View File
@@ -152,7 +152,7 @@ static void on_acd(sd_ipv4acd *acd, int event, void *userdata) {
void *val, *key;
HASHMAP_FOREACH_KEY(val, key, link->ipv4acd_by_address)
if (val == acd) {
(void) address_get(link, key, &address);
(void) address_get_harder(link, key, &address);
break;
}