> If the proposed change is related to commit 26bbf5a314d833bea say so.
> (Yes, I'm asking for an even better commit message.)

I didn't think the two are related, the only connection is that they are both 
victims.



> Why the reshuffle?  What about SERV_DEFAULT 65536 and avoiding the 
reshuffle?

Then the order will be default server, IPv6 literal, IPv4 literal, all-zero 
literal......
Just check the order_qsort() in domain-match.c.




---Original---
From: "Geert Stappers via 
Dnsmasq-discuss"<dnsmasq-discuss@lists.thekelleys.org.uk&gt;
Date: Sat, Jul 23, 2022 23:08 PM
To: "dnsmasq-discuss"<dnsmasq-discuss@lists.thekelleys.org.uk&gt;;
Subject: Re: [Dnsmasq-discuss] [PATCH] Fix --server=/#/...... which was lostin 
2.86


On Sat, Jul 23, 2022 at 02:02:31PM +0000, 谢致邦 (XIE Zhibang) via Dnsmasq-discuss 
wrote:
&gt; A victim of the domain-search rewrite.
&gt; --server=/#/...... means to use the server for default. The new
&gt; implementation orders the default server first, but because of the
&gt; rewrote domain-search, it needs strict-order to ensure the default.


Much better as only the "git commit summary".


If the proposed change is related to commit 26bbf5a314d833bea say so.
(Yes, I'm asking for an even better commit message.)

&nbsp;
&gt; Signed-off-by: 谢致邦 (XIE Zhibang) <yek...@red54.com&gt;
&gt; ---
&gt;&nbsp; src/dnsmasq.h&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | 34 
++++++++++++++++++----------------
&gt;&nbsp; src/domain-match.c | 15 +++++++++++----
&gt;&nbsp; src/network.c&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp; 2 +-
&gt;&nbsp; 3 files changed, 30 insertions(+), 21 deletions(-)
&gt; 
&gt; diff --git a/src/dnsmasq.h b/src/dnsmasq.h
&gt; index a8937ce..7512756 100644
&gt; --- a/src/dnsmasq.h
&gt; +++ b/src/dnsmasq.h
&gt; @@ -534,23 +534,24 @@ union mysockaddr {
&gt;&nbsp; 
&gt;&nbsp; 
&gt;&nbsp; /* The actual values here matter, since we sort on them to get 
records in the order
&gt; -&nbsp;&nbsp; IPv6 addr, IPv4 addr, all zero return, resolvconf servers, 
upstream server, no-data return&nbsp; */
&gt; +&nbsp;&nbsp; IPv6 addr, IPv4 addr, all zero return, default server, 
resolvconf servers, upstream server, no-data return */
&gt;&nbsp; #define SERV_LITERAL_ADDRESS&nbsp;&nbsp;&nbsp; 1&nbsp; /* addr is 
the answer, or NoDATA is the answer, depending on the next four flags */
&gt;&nbsp; #define 
SERV_USE_RESOLV&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2&nbsp; /* 
forward this domain in the normal way */
&gt; -#define 
SERV_ALL_ZEROS&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 4&nbsp; /* 
return all zeros for A and AAAA */
&gt; -#define 
SERV_4ADDR&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 8&nbsp; /* addr is IPv4 */
&gt; -#define 
SERV_6ADDR&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 16&nbsp; /* addr is IPv6 */
&gt; -#define SERV_HAS_SOURCE&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
32&nbsp; /* source address defined */
&gt; -#define SERV_FOR_NODOTS&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
64&nbsp; /* server for names with no domain part only */
&gt; -#define SERV_WARNED_RECURSIVE 128&nbsp; /* avoid warning spam */
&gt; -#define SERV_FROM_DBUS&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
256&nbsp; /* 1 if source is DBus */
&gt; -#define 
SERV_MARK&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 512&nbsp; /* for mark-and-delete and log code */
&gt; -#define SERV_WILDCARD&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
1024&nbsp; /* domain has leading '*' */ 
&gt; -#define SERV_FROM_RESOLV&nbsp;&nbsp;&nbsp;&nbsp; 2048&nbsp; /* 1 for 
servers from resolv, 0 for command line. */
&gt; -#define SERV_FROM_FILE&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 4096&nbsp; /* 
read from --servers-file */
&gt; -#define 
SERV_LOOP&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
8192&nbsp; /* server causes forwarding loop */
&gt; -#define SERV_DO_DNSSEC&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 16384&nbsp; /* 
Validate DNSSEC when using this server */
&gt; -#define SERV_GOT_TCP&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
32768&nbsp; /* Got some data from the TCP connection */
&gt; +#define 
SERV_DEFAULT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
4&nbsp; /* Use the server for default (need strict-order) */
&gt; +#define 
SERV_ALL_ZEROS&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 8&nbsp; /* 
return all zeros for A and AAAA */
&gt; +#define 
SERV_4ADDR&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 16&nbsp; /* addr is IPv4 */
&gt; +#define 
SERV_6ADDR&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 32&nbsp; /* addr is IPv6 */
&gt; +#define SERV_HAS_SOURCE&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
64&nbsp; /* source address defined */
&gt; +#define SERV_FOR_NODOTS&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 128&nbsp; /* 
server for names with no domain part only */
&gt; +#define SERV_WARNED_RECURSIVE 256&nbsp; /* avoid warning spam */
&gt; +#define SERV_FROM_DBUS&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
512&nbsp; /* 1 if source is DBus */
&gt; +#define 
SERV_MARK&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
1024&nbsp; /* for mark-and-delete and log code */
&gt; +#define SERV_WILDCARD&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
2048&nbsp; /* domain has leading '*' */
&gt; +#define SERV_FROM_RESOLV&nbsp;&nbsp;&nbsp;&nbsp; 4096&nbsp; /* 1 for 
servers from resolv, 0 for command line. */
&gt; +#define SERV_FROM_FILE&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 8192&nbsp; /* 
read from --servers-file */
&gt; +#define 
SERV_LOOP&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
16384&nbsp; /* server causes forwarding loop */
&gt; +#define SERV_DO_DNSSEC&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 32768&nbsp; /* 
Validate DNSSEC when using this server */
&gt; +#define SERV_GOT_TCP&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
65536&nbsp; /* Got some data from the TCP connection */

Why the reshuffle?&nbsp; What about SERV_DEFAULT 65536 and avoiding the 
reshuffle?
&nbsp; 


Regards
Geert Stappers
Fully aware that 2^16 does NOT fit in a 16-bit integer.
-- 
Silence is hard to parse

_______________________________________________
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

Reply via email to