Date: Mon, 24 Aug 2020 23:26:00 -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 06:09:23PM -0400, Rich Felker wrote: > 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. I have the attached patches queued now. Rich View attachment "0001-make-h_errno-thread-local.patch" of type "text/plain" (1414 bytes) View attachment "0002-report-res_query-failures-including-nxdomain-nodata-.patch" of type "text/plain" (1556 bytes)
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.