mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Rich Felker <dalias@libc.org>
To: Barry Bond <barrybo@microsoft.com>
Cc: "musl@lists.openwall.com" <musl@lists.openwall.com>
Subject: Re: [musl] Re: [EXTERNAL] Re: [musl] Behavior change in getaddrbyname() with AF_UNSPEC
Date: Tue, 24 Jan 2023 03:54:19 -0500	[thread overview]
Message-ID: <20230124085419.GJ4163@brightrain.aerifal.cx> (raw)
In-Reply-To: <DM6PR21MB16115FA20B15B88628E85867B6C89@DM6PR21MB1611.namprd21.prod.outlook.com>

On Mon, Jan 23, 2023 at 01:34:10AM +0000, Barry Bond wrote:
> I now have more data. The DNS queries are being multcast to a
> customer's mDNS server implementation. I don't have source code
> access to it.

In general, pointing the stub resolver at mDNS is not expected to
work. It might work under some conditions if it's pointed *only* at
mDNS, but the common thing folks try to do like this is pointing
resolv.conf at both a real recursive resolver and mDNS hoping this
will yield a unioned namespace, which is not how it works. Doing that
really requires a unioning proxy resolver (which can also provide
functionality like DNSSEC validation etc if desired).

> Its behavior is to correctly respond to "A" requests, but drop
> "AAAA" requests completely.
> 
> So ​__res_msend_rc() is sending two request messages out ("A" and
> "AAAA"), and getting only 1 response back ("A"). The "AAAA" request
> is resent, then times out. That leaves alens[0]==54 and alens[1]==0.
> That leads to the EAI_AGAIN return in name_from_dns().
> 
> RFC 8906 (https://datatracker.ietf.org/doc/rfc8906/) seems relevant:
> section 3.1.2 says that it is expected the DNS servers return a
> response as if it has no data, for unknown rr types. But that's a
> best practice and not a hard requirement. MUSL before the relevant
> change was OK with a non-reply to the AAAA request, but now requires
> the response.

There are lots of things that are perfectly valid for a nameserver to
do, but which do not answer the question asked by the stub resolver.
And if the question is not answered, it cannot draw any conclusion for
what to give the application.

Timing out then returning success anyway after the timeout was a bug.
It only "worked" for this setup before insomuch as someone was happy
with waiting 5 seconds for each query to "succeed". I'm not sure what
the right waya to do what they want is because I'm not sure exactly
what they're tryng to do, but the old behavior isn't it.

Rich

      reply	other threads:[~2023-01-24  8:54 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-14 22:56 Barry Bond
2023-01-18 15:26 ` Rich Felker
2023-01-19 14:58   ` [musl] RE: [EXTERNAL] " Barry Bond
2023-01-23  1:34     ` [musl] " Barry Bond
2023-01-24  8:54       ` Rich Felker [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230124085419.GJ4163@brightrain.aerifal.cx \
    --to=dalias@libc.org \
    --cc=barrybo@microsoft.com \
    --cc=musl@lists.openwall.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).