From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/13010 Path: news.gmane.org!.POSTED!not-for-mail From: Christopher Friedt Newsgroups: gmane.linux.lib.musl.general Subject: Re: getaddrinfo(3) / AI_ADDRCONFIG Date: Tue, 10 Jul 2018 08:05:50 -0400 Message-ID: References: <20180709223805.GS1392@brightrain.aerifal.cx> <20180710005943.GT1392@brightrain.aerifal.cx> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="0000000000003d78890570a3f429" X-Trace: blaine.gmane.org 1531224253 6457 195.159.176.226 (10 Jul 2018 12:04:13 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 10 Jul 2018 12:04:13 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-13026-gllmg-musl=m.gmane.org@lists.openwall.com Tue Jul 10 14:04:09 2018 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by blaine.gmane.org with smtp (Exim 4.84_2) (envelope-from ) id 1fcrNI-0001ZO-Hv for gllmg-musl@m.gmane.org; Tue, 10 Jul 2018 14:04:08 +0200 Original-Received: (qmail 27823 invoked by uid 550); 10 Jul 2018 12:06:16 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Original-Received: (qmail 27799 invoked from network); 10 Jul 2018 12:06:15 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=KG3dUAwWxEz1C5RIHKim4VfRay5ML8vidcx4z/tjw2w=; b=UqdEMQKLPZ9N2kD75UM0MjU4OuLHGyYF7zLcFaYa0cNWRAJD3zTr85gcfYvzyem0ee dA7NCZL6JCOlkiYIajsOQspAuJFFgugtfciTURJLBK6E8fO9pNkPENJC7xGbKPt35GZD qpR2cHb0QzZVmCYeM0PtImNNGHLtlbMaTpWwy+7LC9atoKpH0jkz2w7cqwLtNPiAU1Jp pgZ3P07UNpqNpbfMbcdsCx8v0neIzl9xZq6wXbtgN6yyOyoNtMGm4J0gAwZxvBeqLGQI bCZ3bhDW15UqO/JuRTMNtRJ4A5dDX1n5yIjp05DQpWNuYKa8oFKsXHNRcmrNd+BGauX/ 7GUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=KG3dUAwWxEz1C5RIHKim4VfRay5ML8vidcx4z/tjw2w=; b=gUmwjpBNX8O97NyjPIMx98lqEhtHYSJ8FErM1VV/akjv5q6DC7im5hFYweDs6quVll ur5rSVpwjr16i8p7WacGodGxBL78rqpbyO/pDr6jmj1HoDU0pidPf5eA6nXIaMMSmjdq Vl7EGjR1ps2X3w8UaOORSC8fSjALHlBerV6QeToeEz7h9E3GlzR6m1EuXpRNRNnzDh+K F3lDezAJA299LT5Isu0aUnuYP9LbqtwlVhg8WKdG1ohrs7LZd170YM12sf/r9MNqWAFC krWJrXpCKfta0KIIyBj0HfhuHH4o+ZRLLTwZZQ7+5zOrmJBA/6Fe146xuNFk7HGPdGb9 pSlg== X-Gm-Message-State: APt69E3+lxG2/29Xk7kTGbfQrY9hlQbMvirZ60cOw5QIs94VpndRl7Ql vIxqrDj5fK2+MBn+g72d5r61h/7OahbPM4iMKBDoIQ== X-Google-Smtp-Source: AAOMgpfNFSEsbycsIyW0VUh16VMoGlW9tobBcbFUG6RALDC1h0iVTB1McE7Dt5AsXy60dBWHk2LaA57ospaG9/T9Wu8= X-Received: by 2002:aca:ad4f:: with SMTP id w76-v6mr29130033oie.233.1531224363200; Tue, 10 Jul 2018 05:06:03 -0700 (PDT) In-Reply-To: <20180710005943.GT1392@brightrain.aerifal.cx> Xref: news.gmane.org gmane.linux.lib.musl.general:13010 Archived-At: --0000000000003d78890570a3f429 Content-Type: text/plain; charset="UTF-8" On Mon, Jul 9, 2018, 9:00 PM Rich Felker, wrote: > Can you provide a minimized test case (short single C source file) to > reproduce this, or an strace log of the test that fails? The latter is > probably actually be better if the behavior is dependent on the Docker > network configuration. Assuming the test is attempting to lookup and > bind on "localhost" by name, which is what it appears to be doing > here: > > > https://github.com/apache/thrift/blob/82ae9575cdc112088771fc7b876f75e1e4d85ebb/lib/cpp/test/TServerSocketTest.cpp > > the behavior you're experiencing is not what I expect from musl; > rather my expectation is that you would get 127.0.0.1 as the first > result and ::1 as the second, and this is exactly what I see if I do: > > ip addr del ::1 dev lo > > on my laptop running Alpine, then call getaddrinfo for localhost with > a small test program. > > The logic to sort results does gratuitously depend on v4mapped > addresses working to do the IPv4 routability probing; if something > about the configuration suppresses their ability to work, it will > break. This is a known open issue I want to go back and fix. Seeing > the strace would show me right away if it's the source of your > problem, and even if not chances are very good that it would point out > whatever the cause is. > Strange - yeah, I'll write up a small program in C to demonstrate. > --0000000000003d78890570a3f429 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


= On Mon, Jul 9, 2018, 9:00 PM Rich Felker, <dalias@libc.org> wrote:
Can you provide a minimized test case (short single C source file) to
reproduce this, or an strace log of the test that fails? The latter is
probably actually be better if the behavior is dependent on the Docker
network configuration. Assuming the test is attempting to lookup and
bind on "localhost" by name, which is what it appears to be doing=
here:

https://github.com/apache/thrift/blob/82ae9575cdc11= 2088771fc7b876f75e1e4d85ebb/lib/cpp/test/TServerSocketTest.cpp

the behavior you're experiencing is not what I expect from musl;
rather my expectation is that you would get 127.0.0.1 as the first
result and ::1 as the second, and this is exactly what I see if I do:

ip addr del ::1 dev lo

on my laptop running Alpine, then call getaddrinfo for localhost with
a small test program.

The logic to sort results does gratuitously depend on v4mapped
addresses working to do the IPv4 routability probing; if something
about the configuration suppresses their ability to work, it will
break. This is a known open issue I want to go back and fix. Seeing
the strace would show me right away if it's the source of your
problem, and even if not chances are very good that it would point out
whatever the cause is.

Strange - yeah, I'll write up a small program in = C to demonstrate.
--0000000000003d78890570a3f429--