[Dnsmasq-discuss] It works: multiple dnsmasqs running

Gene Czarcinski gene at czarc.net
Mon Oct 15 22:22:53 BST 2012


On 10/15/2012 04:02 PM, Simon Kelley wrote:
> On 15/10/12 18:05, Gene Czarcinski wrote:
>
>> I did not really need that because I had already "instrumented"
>> iface_check(). It is failing because iface_check() is checking the wrong
>> list. Instead of checking the daemon->if_names and daemon->if_addrs
>> lists which it does, it should be checking the daemon->interfaces list
>> which is very carefully built when enumerate_interfaces() is called in
>> dnsmasq.c
>
> But daemon->if_addrs is the address(es) given in --listen-address 
> config items, command line or config file. That's what you want to 
> check against.
>>
>> iface_check() is called a lot and I don't know if changing it would
>> break something else but having a new interfaces_check() should work ...
>> or, just put the code into dhcp6_packet().
>
> Checking against daemon->interfaces will break things.
OK, I thought I had given up on the idea of a separate interface_check() 
but it looks like that is still needed or changing the calling sequence 
of iface_check().

The address we have is going to be ff00::1:2 so checking the address 
list against it is useless.  Scanning daemon->if_names is still needed.  
Also daemon->interfaces is lacking some info we need namely AF_INET or 
AF_INET6 but it seems to me that it could easily be added.

We need to go through daemon->interfaces to find the ip6 addresses 
associated with the device name we have.  Then, that address needs to be 
compared with any IPv6 addresses specified in --listen-address.

We could just do this check for dhcp6 ... would that break things?

Any favorite approaches: just dhcp6 .. or .. extra calling sequence 
parameter/flag ... or ... a new, separate function?  The last two are 
the "safest".

Gene



More information about the Dnsmasq-discuss mailing list