[Dnsmasq-discuss] Infinite loop in match_netid_wild

Fina fina at felinira.net
Sat Oct 11 22:44:42 UTC 2025


Hi,

I am currently debugging an a hang in match_netid_wild. It looks like 
that with my specific configuration the linked list in 'pool' is circular.

This reproducibly happens to me after successfully negotiating PXE once, 
and then resetting the client and doing it a second time.

Minimal config:


dnsmasq: started, version 2.91 cachesize 150 
  

dnsmasq: compile time options: IPv6 GNU-getopt DBus no-UBus i18n IDN2 
DHCP DHCPv6 no-Lua TFTP conntrack ipset nftset auth DNSSEC loop-detect 
inotify dumpfile
dnsmasq-dhcp: DHCP, proxy on subnet 192.168.2.0
dnsmasq-tftp: TFTP root is /srv/tftp
dnsmasq: using nameserver 192.168.2.10#53
dnsmasq: using nameserver 192.168.100.1#53
dnsmasq: read /etc/hosts - 8 names
dnsmasq-dhcp: 1322097232 available DHCP subnet: 192.168.2.0/255.255.255.0
dnsmasq-dhcp: 1322097232 vendor class: PXEClient:Arch:00000:UNDI:002001
dnsmasq-dhcp: 1322097232 user class: iPXE
dnsmasq-dhcp: 1322097232 PXE(vmbr0) 52:54:00:59:90:59 proxy
dnsmasq-dhcp: 1322097232 tags: ipxe, proxy, X86PC, ipxe-http, ipxe-menu, 
ipxe-pxe, ipxe-bzimage, vmbr0
dnsmasq-dhcp: 1322097232 bootfile name: ltsp/ltsp.ipxe
dnsmasq-dhcp: 1322097232 broadcast response
dnsmasq-dhcp: 1322097232 sent size:  1 option: 53 message-type  2
dnsmasq-dhcp: 1322097232 sent size:  4 option: 54 server-identifier 
192.168.2.20
dnsmasq-dhcp: 1322097232 sent size:  9 option: 60 vendor-class 
50:58:45:43:6c:69:65:6e:74
dnsmasq-dhcp: 1322097232 sent size: 17 option: 97 client-machine-id 
00:3d:94:7f:be:64:70:88:46:b5:3d:16:13:66...
dnsmasq-dhcp: 1322097232 sent size: 33 option: 43 vendor-encap 
06:01:03:0a:04:00:50:58:45:08:07:80:02:01...
dnsmasq-dhcp: 1322097232 available DHCP subnet: 192.168.2.0/255.255.255.0
dnsmasq-dhcp: 1322097232 vendor class: PXEClient:Arch:00000:UNDI:002001
dnsmasq-dhcp: 1322097232 user class: iPXE
dnsmasq-dhcp: 0 available DHCP subnet: 192.168.2.0/255.255.255.0
dnsmasq-dhcp: 0 vendor class: PXEClient
dnsmasq-dhcp: 0 user class: iPXE
dnsmasq-dhcp: 0 PXE(vmbr0) 192.168.2.224 52:54:00:59:90:59 ltsp/ltsp.ipxe
dnsmasq-dhcp: 0 tags: ipxe, X86PC, ipxe-http, ipxe-menu, ipxe-pxe, 
ipxe-bzimage, vmbr0
dnsmasq-dhcp: 0 bootfile name: ltsp/ltsp.ipxe
dnsmasq-dhcp: 0 next server: 192.168.2.20
dnsmasq-dhcp: 0 broadcast response
dnsmasq-dhcp: 0 sent size:  1 option: 53 message-type  5
dnsmasq-dhcp: 0 sent size:  4 option: 54 server-identifier  192.168.2.20
dnsmasq-dhcp: 0 sent size:  9 option: 60 vendor-class 
50:58:45:43:6c:69:65:6e:74
dnsmasq-dhcp: 0 sent size: 17 option: 97 client-machine-id 
00:3d:94:7f:be:64:70:88:46:b5:3d:16:13:66...
dnsmasq-dhcp: 0 sent size:  7 option: 43 vendor-encap  47:04:80:02:00:00:ff
dnsmasq-tftp: sent /srv/tftp/ltsp/ltsp.ipxe to 192.168.2.224

<client reset>

dnsmasq-dhcp: 2407115012 available DHCP subnet: 192.168.2.0/255.255.255.0
dnsmasq-dhcp: 2407115012 vendor class: PXEClient:Arch:00000:UNDI:002001
dnsmasq-dhcp: 2407115012 user class: iPXE

(gdb) p tmp1
$2 = (struct dhcp_netid *) 0x5555555d2b10
(gdb) p tmp1->next
$3 = (struct dhcp_netid *) 0x5555555d2bb0
(gdb) p tmp1->next->next
$4 = (struct dhcp_netid *) 0x7fffffffde50
(gdb) p tmp1->next->next->next
$5 = (struct dhcp_netid *) 0x5555555d26d0
(gdb) p tmp1->next->next->next->next
$6 = (struct dhcp_netid *) 0x5555555d29d0
(gdb) p tmp1->next->next->next->next->next
$7 = (struct dhcp_netid *) 0x5555555d2a70
(gdb) p tmp1->next->next->next->next->next->next
$8 = (struct dhcp_netid *) 0x5555555d2b10

(gdb) bt
#0  match_netid_wild (check=0x5555555d2f90, 
pool=pool at entry=0x5555555d2cd0) at 
./debian/auto-build/dnsmasq-base/dhcp-common.c:97
#1  0x00005555555a0aad in run_tag_if (tags=0x5555555d2cd0, 
tags at entry=0x5555555d2680) at 
./debian/auto-build/dnsmasq-base/dhcp-common.c:121
#2  0x00005555555a0bed in option_filter (tags=tags at entry=0x5555555d26d0, 
context_tags=0x5555555d2680, opts=0x5555555d21e0, pxemode=pxemode at entry=2)
     at ./debian/auto-build/dnsmasq-base/dhcp-common.c:174
#3  0x000055555558f485 in dhcp_reply (context=<optimized out>, 
iface_name=iface_name at entry=0x7fffffffe0a0 "vmbr0", 
int_index=int_index at entry=4,
     sz=sz at entry=407, now=now at entry=1760220211, 
unicast_dest=unicast_dest at entry=0, loopback=<optimized out>, 
is_inform=<optimized out>, pxe=<optimized out>,
     fallback=..., recvtime=<optimized out>) at 
./debian/auto-build/dnsmasq-base/rfc2131.c:965
#4  0x000055555558637c in dhcp_packet (now=now at entry=1760220211, 
pxe_fd=pxe_fd at entry=0) at ./debian/auto-build/dnsmasq-base/dhcp.c:340
#5  0x000055555555f90f in main (argc=<optimized out>, argv=<optimized 
out>) at ./debian/auto-build/dnsmasq-base/dnsmasq.c:1299




More information about the Dnsmasq-discuss mailing list