Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Mon, 24 Aug 2020 18:09:23 -0400
From: Rich Felker <dalias@...c.org>
To: musl@...ts.openwall.com
Subject: Re: Incompatible behaviour of res_query(3) w.r.t. NXDOMAIN

On Mon, Aug 24, 2020 at 11:51:52PM +0200, Daniel Neri wrote:
> On 24 Aug 2020, at 23:32, Rich Felker <dalias@...c.org> wrote:
> > 
> > Does such a distinction exist? I thought res_query was just equivalent
> > to res_mkquery+res_send and that calling res_send directly would get
> > you the same errors.
> 
> I thought so too, but I’ve been reading the musl implementation. ;-)
> 
> After looking more at the other implementations, I think Florian is
> correct though: it’s more like res_mkquery+res_send+setting h_errno
> and the return value based on the RCODE of the response.

If this is indeed the case and the right behavior can be obtained
reliably by ignoring res_query and using res_mkquery+res_send, I have
no fundamental objection to changing this. However we should have a
plan for moving h_errno to be thread-local and figuring out what
breakage if any there could be for apps built with it global.

Thankfully, it looks like we're already using (*__h_errno_location())
even though it was not thread-local, so existing apps built against
current musl headers should be immediately compatible with changing it
to be thread-local.

Rich

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.