[Dnsmasq-discuss] Is dnsmasq supposed to listen on UDP port 0.0.0.0:67 when listen-address is specified?

Kurt H Maier khm at sciops.net
Thu Dec 21 03:47:15 GMT 2017


On Wed, Dec 20, 2017 at 06:40:10PM -0800, Parke wrote:
> Hi,
> 
> Here is a minimal, three line test.conf file:

If I understand this right, I think I can replicate it with e.g.

dnsmasq --interface=eth0 \
--dhcp-range=192.168.0.50,192.168.0.100,12h \
--bind-interfaces \
--listen-address=192.168.1.50

In this case, we can trace this to get:
setsockopt(4, SOL_SOCKET, SO_BROADCAST, [1], 4) = 0
setsockopt(4, SOL_SOCKET, SO_REUSEPORT, [1], 4) = 0
setsockopt(4, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0
bind(4, {sa_family=AF_INET, sin_port=htons(67), sin_addr=inet_addr("0.0.0.0")}, 16) = 0
...
setsockopt(4, SOL_SOCKET, SO_BINDTODEVICE, "eth0\0\0\0\0\0\0\0\0\0\0\0\0", 16) = 0

So, while SO_REUSEPORT and SO_REUSEADDR are both successful, I'm not
able to create another socket to listen (dnsmasq fails with the address
already in use error).

khm



More information about the Dnsmasq-discuss mailing list