[Dnsmasq-discuss] [BUG] dnsmasq "dynamic-hosts" ignores /16 IPv4 addresses on interfaces entirely

Mark Dietzer dnsmasq at doridian.net
Sun Oct 9 01:48:03 UTC 2022


It seems dnsmasq does not work with its dynamic-host option specifically if your subnet is a /16 (IPv4).

I suspect the bug is in src/network.c (line 363-364), which read:
> if (netmask.s_addr == 0xffff)
>     continue;

This to me very much reads like it checks the netmask for 0xFFFF, which is a /16 and skips ahead.
My assumption is the intention here was to check for /32 (so 0xFFFFFFFF)?

I have confirmed this locally with dnsmasq completely ignoring any interface address that is /16 subnetted for the purposes of "dynamic-host" with the current git version. Any other subnet size works fine.

Sorry if this reads a bit weirdly, this is my first time ever posting on a mailing list.

Regards,
Mark "Doridian" Dietzer



More information about the Dnsmasq-discuss mailing list