Re: [Dnsmasq-discuss] [PATCH] --local is broken

2021-10-05 Thread Simon Kelley
On 05/10/2021 21:50, Petr Menšík wrote:
> I have already reported it, but might got lost in different thread.
> 
> https://lists.thekelleys.org.uk/pipermail/dnsmasq-discuss/2021q3/015723.html
> 
> I took a look at the change, it seems it was intentional. Your proposed
> change would break something else Simon tried to fix in commit 26bbf5a3
> I think.
> 
> I think --address=/#/1.2.3.4 got broken. Which should be roughly
> equivalent to --address=/./1.2.3.4, now that just . is accepted itself.
> It got threated as --address=//1.2.3.4 in previous versions by mistake.
> Your fix would restore --local=/test/1.1.1.1, but would break this part
> again. 

I can't find an example of that. I think Dominik's patch is correct.
(though I have to admit, I can't remember what problem I was trying to
solve with the change from option == 'A' to option != 'S'. Whatever it
was is spurious, as far as I can tell now.

We now have the situation that

--address=1.2.3.4
--address=/#/1.2.3.4
--address=/./1.2.3.4

all now do exactly the same thing, which is curious, but not a disaster.

> That is why I had not attached patch to it, because correct fix
> it more demanding. And address+server parsing is complicated enough now.
> I think --local should emit warning if used with an address. I think its
> intention was to be used just with domains like --local=/invalid/,
> entries containing server also should use --server instead.
> 

That may be what I was trying to fix. If the man page says that --local
is a synonym for --server, then it should be. Clearly from Dominik's
error reports, his users have been using --local=/example.com/1.2.3.4
and understanding its sematics OK.

Cheers,

Simon.

> Cheers,
> Petr
> 
> On 10/5/21 20:52, Dominik Derigs wrote:
>> Hey Simon,
>>
>> Since commit "Fix --address=/#/.. which was lost in 2.86"
>> (26bbf5a314d833beaf0f147d24409969f05f3dba) --local being a
>> synonym for --server is broken as --local became a synonym for --
>> address.
>>
>> The attached patch fixes this.
>>
>> This was reported on the Pi-hole forums:
>>
>>> I have local=/fritz.box/192.168.0.1 in my /etc/dnsmasq.d/02-
>>> localdns.conf config file. This worked fine until upgrading
>>> pihole last night. Now all queries to FQDNs such as google.com
>>> get responded with google.com.fritz.box and ip address
>>> 192.186.0.1.
>>>
>>> Changing the line to server=/fritz.box/192.168.0.1 restores the
>>> previous handling. However, according to the dnsmasq manpage "-
>>> -local is a synonym for --server to make configuration files
>>> clearer in this case."
>> Best,
>> Dominik
>>
>> ___
>> Dnsmasq-discuss mailing list
>> Dnsmasq-discuss@lists.thekelleys.org.uk
>> https://lists.thekelleys.org.uk/cgi-bin/mailman/listinfo/dnsmasq-discuss
> 
> -- 
> Petr Menšík
> Software Engineer
> Red Hat, http://www.redhat.com/
> email: pemen...@redhat.com
> PGP: DFCF908DB7C87E8E529925BC4931CA5B6C9FC5CB
> 
> 
> ___
> Dnsmasq-discuss mailing list
> Dnsmasq-discuss@lists.thekelleys.org.uk
> https://lists.thekelleys.org.uk/cgi-bin/mailman/listinfo/dnsmasq-discuss
> 


___
Dnsmasq-discuss mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
https://lists.thekelleys.org.uk/cgi-bin/mailman/listinfo/dnsmasq-discuss


Re: [Dnsmasq-discuss] [PATCH] --local is broken

2021-10-05 Thread Simon Kelley
On 05/10/2021 19:52, Dominik Derigs wrote:
> Hey Simon,
> 
> Since commit "Fix --address=/#/.. which was lost in 2.86"
> (26bbf5a314d833beaf0f147d24409969f05f3dba) --local being a
> synonym for --server is broken as --local became a synonym for --
> address.
> 
> The attached patch fixes this.
> 
> This was reported on the Pi-hole forums:
> 
>> I have local=/fritz.box/192.168.0.1 in my /etc/dnsmasq.d/02-
>> localdns.conf config file. This worked fine until upgrading
>> pihole last night. Now all queries to FQDNs such as google.com
>> get responded with google.com.fritz.box and ip address
>> 192.186.0.1.
>>
>> Changing the line to server=/fritz.box/192.168.0.1 restores the
>> previous handling. However, according to the dnsmasq manpage "-
>> -local is a synonym for --server to make configuration files
>> clearer in this case."
> 
> Best,
> Dominik
> 

Patch applied. More discussion in my reply to Petr's reply.


Simon.


___
Dnsmasq-discuss mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
https://lists.thekelleys.org.uk/cgi-bin/mailman/listinfo/dnsmasq-discuss