[Dnsmasq-discuss] bind-dynamic race condition

Francesco francesco.montorsi at gmail.com
Wed Nov 4 10:08:26 UTC 2026


Hi,
Looking at the mailing list I see that the standard way to go is
attach a patch to the email, so there we go.
This patch allows you to reproduce, in a few seconds/minutes the race
condition I mentioned in my previous email.

I might try to propose a fix if there is interest!

Thanks,
Francesco

Il giorno mar 3 nov 2026 alle ore 14:55 Francesco
<francesco.montorsi at gmail.com> ha scritto:
>
> Hi all,
>
> First of all thanks for developing and maintaining dnsmasq, it's really useful and I'm the maintainer of an addon that integrates it with HomeAssistant (https://github.com/f18m/ha-addon-dnsmasq-dhcp).
>
> I recently started using the "bind-dynamic" feature and I have definitively isolated a bug in dnsmasq: I can reproduce an intermittent issue with dnsmasq 2.93-44-g10fbc39 on Linux using bind-dynamic. I created an isolated test to reproduce it, based on docker (compose).
>
> What happens is that after repeated creation and removal of Docker bridge container endpoints, dnsmasq stops listening on 127.0.0.1 over both UDP and TCP, while the IPv6 listener on ::1 remains. Its log reports:
>
> stopped listening on lo(#1): 127.0.0.1 port 1053
>
> The reproducer uses dnsmasq in host networking, bound only to 127.0.0.1:1053, and repeatedly creates/removes short-lived containers on an IPv6-enabled bridge. It reproduced after 11 and 40 cycles on Linux 7.2.10-200.fc44.x86_64 with Docker Engine 29.9.0. I can provide the minimal Docker Compose reproducer.
>
> I suspect there is a race condition somewhere related to the bind-dynamic implementation.
>
> What is the best way to share the test that reproduces this issue with you?
>
> I didn't find any bug tracker and although I git cloned the source, I'm not sure in which format you prefer to receive the test that reproduces the bug... should I send a .patch file?
>
> Thanks,
>
> Francesco Montorsi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dnsmasq-bind-dynamic-veth-repro.patch
Type: text/x-patch
Size: 6510 bytes
Desc: not available
URL: <http://lists.thekelleys.org.uk/pipermail/dnsmasq-discuss/attachments/20261104/e769edf1/attachment.bin>


More information about the Dnsmasq-discuss mailing list