This is another take on a recurring problem. There is a facility to work around it by allowing multiple addresses to be specified in dhcp-host. That works for the specific case of chain-netbooting, where the host's DUID changes at each stage of the boot. I appreciate that may not be the problem you are solving.

This patch works by confusing a dhcp-host declaration with a DHCPv6 lease. They are not the same thing. For instance it's possible to have more than on dhcp-host bound to the same DUID or MAC address or hostname, but on different subnets. I think it may be better to not use dhcp-host at all, but to just work with dhcp leases. Even DHCPv6 leases store the MAC address if it's known, so the RFC3315-violating behaviour could be:

if (a lease exists for the MAC address, but with different (DUID,IAID)) then delete the lease and free the associated address.

There's a slight problem that MAC addresses do not get written to the persistent lease file for DHCPv6 leases, but that could be solved in a backwards compatible way fairly easily.

TL;DR I'm in favour of fixing this problem, but the current approach seems wrong; I can't convince myself that there won't be undesireable consequences.

Cheers,

Simon.


On 21/03/2022 07:55, renmingshuai via Dnsmasq-discuss wrote:
In some cases, such as system reinstallation, the duid of the client has changed when the client renews the lease. dnamsq will assign a new lease back to the client if the new lease is available. However, if the old lease of the client is not released or the client cannot actively release the old lease for some reasons, the client cannot obtain for a new lease until the old lease expires when dnsmasq has no free lease.

Although both duid and MAC addresses are used to identify clients, can dnsmasq consider providing the new switch --bind-mac-with-ipv6 for users to choose to forcibly remove clients marked with DUID or not. When dnsmasq starts with --bind-mac-with-ipv6, it will assign the lease whose mac address is same with the client's to the client , even if that lease has a different duid than the client's.

See attachment for patch.

cheers,

mingshuai


_______________________________________________
Dnsmasq-discuss mailing list
[email protected]
https://lists.thekelleys.org.uk/cgi-bin/mailman/listinfo/dnsmasq-discuss

_______________________________________________
Dnsmasq-discuss mailing list
[email protected]
https://lists.thekelleys.org.uk/cgi-bin/mailman/listinfo/dnsmasq-discuss

Reply via email to