[Dnsmasq-discuss] [PATCH] fix(dhcp): prevent cyclic linked list
Guilherme Puida Moreira
guilherme.moreira at canonical.com
Thu Nov 12 11:55:42 UTC 2026
Hello Johannes,
On 11/12/26 3:35 AM, Johannes Geiss via Dnsmasq-discuss wrote:
> Hello Dnsmasq developers,
>
> I am using Dnsmasq to manage PXE-boots for my RaspberryPi boards. The
> network is managed by a switch with DHCP, so Dnsmask uses DHCP-proxy to
> enable PXE-boot and DHCP-given addresses from that switch.
>
> A fresh started Dnsmasq-daemon works fine for the first boot of a
> RaspberryPi. But when I reboot this RaspberryPi, Dnsmasq gets stuck in
> a look using 100 % CPU.
>
> I located this problem to be in match_netid(struct dhcp_netid *check,
> struct dhcp_netid *pool, int tagnotneeded). The linked list pool is
> never ending. It cycles to itself.
>
> My configuration is
>
> dhcp-range = set:pxe-lan, 10.10.42.0, proxy
> dhcp-host = dc:a6:32:13:65:54, set:raspberrypi, raspberrypi-4
> dhcp-vendorclass = set:RPi, PXEClient:Arch:00000:UNDI:002001
> pxe-service = tag:RPi, tag:raspberrypi, X86PC, "Raspberry Pi Boot",
> bootcode.bin, johannes-pc-linux
>
> enable-tftp
> tftp-root = /var/local/systems
> tftp-no-fail
>
> With help of AI i analysed and fixed the problem. The patch is attached
> to this mail. With this patch everything works fine at my side.
>
> Maybe you can take a look at this patch, whether it is OK and if it
> worth to be used.
We also hit this same issue a few months ago, and I've proposed a
smaller/simpler fix (see [1]). Can you please check if that patch also
fixes your issue?
We've been carrying that patch in Ubuntu for a bit now, it would be nice
to have it upstream.
[1]:
https://lists.thekelleys.org.uk/pipermail/dnsmasq-discuss/2026q3/018553.html
Cheers,
--
Guilherme Puida Moreira
More information about the Dnsmasq-discuss
mailing list