Skip to content

dhcp: fix ACD state after DHCP expiry

Beniamino Galvani requested to merge bg/dhcp-expiry-acd into main

Summary

When the lease is lost, NM tries to get a new by restarting the DHCP transaction. However, it doesn't delete the existing l3cds (one from the DHCP client with flag ONLY_FOR_ACD, the other from NMDevice). Therefore, the l3cfg still tracks the ACD state of the address as "external-removed", and when NM gets the same address via DHCP, ACD is considered as failed; as a consequence, NM sends a DECLINE message to the server.

Moreover, the l3cd added by NMDevice for DHCP has a zero ACD timeout, and so it's not possible to do ACD again on the same address.

Remove those l3cds when the lease expires, so that any ACD state is cleared and DHCP can perform ACD again.

Fixes: 240ec7f8 ('dhcp: implement ACD (address collision detection) for DHCPv4')

--

I see the problem in a VM, when the host is suspended for a time greater than the lease lifetime: after resuming the VM repeatedly tries to get a new address and keeps sending a DECLINE.

Resolves: https://issues.redhat.com/browse/RHEL-24127

Edited by Beniamino Galvani

Merge request reports

Loading