[Dnsmasq-discuss] [patch] Answer DHCP requests when dnsmasq is not bound to the 1st IP of an interface

dnsmasq.20.masuefke at spamgourmet.com dnsmasq.20.masuefke at spamgourmet.com
Sun Nov 20 08:03:04 GMT 2011


Hello,

I ran into an unusual situation:
- Network interface is br0, two IPv4 addresses assigned.
- First ip port 53 occupied by other dns resolver
- Dnsmasq had to be bound to the 2nd ip with options "bind-interfaces"
and "listen-address=<2nd ip>"
--> Dnsmasq did not respond to dhcp requests anymore.

The problem  was traced to dnsmasq checking only an interfaces with
ioctl( ... SIOCGIFADDR ... ) in dhcp.c  at line ca 245

The patch seems a bit crude but works.
I have built it on Linux/amd64 with IPv4, no clue about BSD, Solaris and
IPv6 at all.
Also, I have not figured out the best place where to enable the patch
with #define. For now it's enabled in dnsmasq.h

In the patch, there are quite some many my_syslog( ) statements used for
debugging the new code. You will not want to run that in production as
it spams the log.

The patch is against dnsmasq-2.57, I hope that does not cause too much
trouble.

-Martin
PS: I may not stay on the list for long, please CC me in replies.

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: dnsmasq-2.57_alternate_ipv4.patch
Url: http://lists.thekelleys.org.uk/pipermail/dnsmasq-discuss/attachments/20111120/9ecdaa02/attachment.txt 


More information about the Dnsmasq-discuss mailing list