From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, MAILING_LIST_MULTI,NICE_REPLY_A,RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 26127 invoked from network); 30 Jul 2020 15:20:51 -0000 Received: from mother.openwall.net (195.42.179.200) by inbox.vuxu.org with ESMTPUTF8; 30 Jul 2020 15:20:51 -0000 Received: (qmail 30030 invoked by uid 550); 30 Jul 2020 15:20:50 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Reply-To: musl@lists.openwall.com Received: (qmail 30011 invoked from network); 30 Jul 2020 15:20:49 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bell-sw-com.20150623.gappssmtp.com; s=20150623; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding:content-language; bh=Os7pRxhffmE2QC2iJ1CX5laWN+kkUeGq+BIwbwAgoo0=; b=LOaPJdmCSZuAo1gKKUpilp2Fvz9SvFJ2du2uKMVi+V0mQs/dFrgAOHOWiQJrr9AIDn TEY5fA73yATpG4FyUc0WdhkzXlZlrGD95fGZ0HLzJzVIcnjtrpwmPFc7uvZ4CNcJkRpm Epv+/gGHx9072HtBltqnb6h+/yR4fnyYhWzyKytoCLJIeU6mht5YIRp1FNS0kc026V9W CmPu2w+i2BFjKaPFp3a6l/gfFaImXz7KNyyLY60s5dVxn0KJiequ7TxS2fVmwqlSCKsw CKwI3+qZogl61MCqdEtU03NzbVVxghta+t75jDYqbsGMvbV3pzXW0AE++r8DOxNcC4ry ad+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=Os7pRxhffmE2QC2iJ1CX5laWN+kkUeGq+BIwbwAgoo0=; b=crVZcj8TPcfR23lzgsR5c8TA3dAFF7nw0/FqIt9/I+rowhRlkebQfTfdYmqZfrGfbd 7EubtKjwB2f2o2/kpd/SorL0pFQDiRdoaBCTyqCUML8Yuu7PXnggEtArocTKh+Tz8H5e qRpmgw8MM0fwt7S6jWRMcvE8duNXtFDpS4ZVWpRMJyFajCbj9fIn934X9ohcQb2ZIvVv 0VUpy2m2pxIAGnu56+tSG0xfjxjwplFTuiBaf5f0gjxNiXoxJHETzBb706ozxr97/By3 mRSf4hzMEc6XkXbQMdl+oWr4BmOJyE70OIcCR8G4RmTfPr8jpj5LIaw3vHhfSsFvGC+u FUqA== X-Gm-Message-State: AOAM531/s1UvgYgqI17ZR0565TbYMU4QJ2JunYHqSTCVf5ODJKMLsJau oHmFglc0iEXiwMu4LWCQEffINMhxkyc= X-Google-Smtp-Source: ABdhPJwqbUOsG8hFQ/zGGomNpe1gGPy8xfa7CEdcziHPEdB19n7QMONS3ZZh/57AQEurcVLDoZTrAg== X-Received: by 2002:a2e:7314:: with SMTP id o20mr1800775ljc.233.1596122438277; Thu, 30 Jul 2020 08:20:38 -0700 (PDT) To: musl@lists.openwall.com, Rich Felker References: <89b25567-5887-80ee-bfac-58b25e7a9b45@bell-sw.com> <20200227144523.GE11469@brightrain.aerifal.cx> From: Alexander Scherbatiy Message-ID: <6b3be14d-214d-9dde-86d2-1d97684f4004@bell-sw.com> Date: Thu, 30 Jul 2020 18:20:36 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <20200227144523.GE11469@brightrain.aerifal.cx> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US Subject: Re: [musl] getaddrinfo(3) with AI_V4MAPPED and AI_ALL flags  glibc getaddrinfo(3) function uses /etc/gai.conf file to sort addrinfo results.  does musl getaddrinfo(3) implementations allows to configure the results order? Thanks, Alexander. On 27.02.2020 17:45, Rich Felker wrote: > On Thu, Feb 27, 2020 at 01:17:20PM +0300, Alexander Scherbatiy wrote: >> Hello, >> >> When I call getaddrinfo() with different families, SOCK_STREAM >> socktype, IPPROTO_TCP protocol, and AI_PASSIVE flag the result is >> the same on the Alpine Linux 3.11.3 and Ubuntu 19.10 (the code >> sample is below): >> >> ---------------- >> >> family: AF_UNSPEC, flags: AI_PASSIVE >> AF_INET  IPv4 addr '0.0.0.0' >> AF_INET6 IPv6 addr '::' >> >> family: AF_INET,   flags: AI_PASSIVE >> AF_INET  IPv4 addr '0.0.0.0' >> >> family: AF_INET6,  flags: AI_PASSIVE >> AF_INET6 IPv6 addr '::' >> >> ---------------- >> >> When I use getaddrinfo() with AF_INET6 family and additional >> AI_V4MAPPED | AI_ALL (return both IPv6 and IPv4-mapped IPv6 >> addresses) flags the result on Ubuntu contains only IPv6 '::' >> address: >> >> ---------------- >> >> family: AF_INET6,  flags: AI_PASSIVE | AI_V4MAPPED | AI_ALL >> AF_INET6 IPv6 addr '::' >> >> ---------------- >> >> whereas the result on Alpine Linux contains both IPv4-mapped IPv6 >> addresses '::ffff:0.0.0.0' and  IPv6 '::' >> >> ---------------- >> >> family: AF_INET6,  flags: AI_PASSIVE | AI_V4MAPPED | AI_ALL >> AF_INET6 IPv6 addr '::ffff:0.0.0.0' >> AF_INET6 IPv6 addr '::' >> >> ---------------- >> >> Is it expected behavior? >> >> I use Alpine Linux 3.11.3 from docker with musl libc (x86_64). > The musl behavior is as intended and I think it's more correct. If > net.ipv6.bindv6only sysctl is enabled, binding using the glibc results > would fail to accept ipv4 connections. > > Rich