[Dnsmasq-discuss] [PATCH] Fix --server=/#/...... which was lostin 2.86

Geert Stappers stappers at stappers.nl
Thu Aug 4 16:38:52 UTC 2022


On Sun, Jul 24, 2022 at 12:06:51AM +0800, 谢致邦(XIE Zhibang) via Dnsmasq-discuss wrote:
> From: "Geert Stappers via Dnsmasq-discuss", Date: Sat, Jul 23, 2022 23:08 PM
> > On Sat, Jul 23, 2022 at 02:02:31PM +0000, 谢致邦 (XIE Zhibang) via Dnsmasq-discuss wrote:
> > > A victim of the domain-search rewrite.
> > > --server=/#/...... means to use the server for default. The new
> > > implementation orders the default server first, but because of the
> > > 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.)
> 
> I don't think the two are related, the only connection is that they are both victims.

My gut feeling says the commit message should be better.


 
> > > --- a/src/dnsmasq.h
> > > +++ b/src/dnsmasq.h
> > > @@ -534,23 +534,24 @@ union mysockaddr {
> > >  
> > >  
> > >  /* The actual values here matter, since we sort on them to get records in the order
> > > -   IPv6 addr, IPv4 addr, all zero return, resolvconf servers, upstream server, no-data return  */
> > > +   IPv6 addr, IPv4 addr, all zero return, default server, resolvconf servers, upstream server, no-data return */
> > >  #define SERV_LITERAL_ADDRESS    1  /* addr is the answer, or NoDATA is the answer, depending on the next four flags */
> > >  #define SERV_USE_RESOLV         2  /* forward this domain in the normal way */
> > > -#define SERV_ALL_ZEROS          4  /* return all zeros for A and AAAA */
> > > -#define SERV_4ADDR              8  /* addr is IPv4 */
> > > -#define SERV_6ADDR             16  /* addr is IPv6 */
> > > -#define SERV_HAS_SOURCE        32  /* source address defined */
> > > -#define SERV_FOR_NODOTS        64  /* server for names with no domain part only */
> > > -#define SERV_WARNED_RECURSIVE 128  /* avoid warning spam */
> > > -#define SERV_FROM_DBUS        256  /* 1 if source is DBus */
> > > -#define SERV_MARK             512  /* for mark-and-delete and log code */
> > > -#define SERV_WILDCARD        1024  /* domain has leading '*' */ 
> > > -#define SERV_FROM_RESOLV     2048  /* 1 for servers from resolv, 0 for command line. */
> > > -#define SERV_FROM_FILE       4096  /* read from --servers-file */
> > > -#define SERV_LOOP            8192  /* server causes forwarding loop */
> > > -#define SERV_DO_DNSSEC      16384  /* Validate DNSSEC when using this server */
> > > -#define SERV_GOT_TCP        32768  /* Got some data from the TCP connection */
> > > +#define SERV_DEFAULT            4  /* Use the server for default (need strict-order) */
> > > +#define SERV_ALL_ZEROS          8  /* return all zeros for A and AAAA */
> > > +#define SERV_4ADDR             16  /* addr is IPv4 */
> > > +#define SERV_6ADDR             32  /* addr is IPv6 */
> > > +#define SERV_HAS_SOURCE        64  /* source address defined */
> > > +#define SERV_FOR_NODOTS       128  /* server for names with no domain part only */
> > > +#define SERV_WARNED_RECURSIVE 256  /* avoid warning spam */
> > > +#define SERV_FROM_DBUS        512  /* 1 if source is DBus */
> > > +#define SERV_MARK            1024  /* for mark-and-delete and log code */
> > > +#define SERV_WILDCARD        2048  /* domain has leading '*' */
> > > +#define SERV_FROM_RESOLV     4096  /* 1 for servers from resolv, 0 for command line. */
> > > +#define SERV_FROM_FILE       8192  /* read from --servers-file */
> > > +#define SERV_LOOP           16384  /* server causes forwarding loop */
> > > +#define SERV_DO_DNSSEC      32768  /* Validate DNSSEC when using this server */
> > > +#define SERV_GOT_TCP        65536  /* Got some data from the TCP connection */
> > 
> > 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.      

That seems a response to
> > Why the reshuffle?


Please also respond to
> > What about SERV_DEFAULT 65536 and avoiding the reshuffle?


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



More information about the Dnsmasq-discuss mailing list