From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/4306 Path: news.gmane.org!not-for-mail From: Laurent Bercot Newsgroups: gmane.linux.lib.musl.general Subject: Re: IPv4 and IPv6 addresses in resolv.conf Date: Sat, 30 Nov 2013 09:13:32 +0000 Message-ID: <5299AC3C.8020405@skarnet.org> References: <761df492-c2ee-41d5-84f8-faef313164bf@email.android.com> <20131129174410.GD24286@brightrain.aerifal.cx> <20131130003704.GL24286@brightrain.aerifal.cx> <20131130031744.GM24286@brightrain.aerifal.cx> <20131130035116.GO24286@brightrain.aerifal.cx> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1385802828 24375 80.91.229.3 (30 Nov 2013 09:13:48 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 30 Nov 2013 09:13:48 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-4310-gllmg-musl=m.gmane.org@lists.openwall.com Sat Nov 30 10:13:51 2013 Return-path: Envelope-to: gllmg-musl@plane.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1VmgcZ-0002aG-Kn for gllmg-musl@plane.gmane.org; Sat, 30 Nov 2013 10:13:51 +0100 Original-Received: (qmail 21942 invoked by uid 550); 30 Nov 2013 09:13:48 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 21934 invoked from network); 30 Nov 2013 09:13:48 -0000 X-SourceIP: 89.100.252.69 User-Agent: Mozilla/5.0 (Windows NT 6.2; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.1.1 In-Reply-To: <20131130035116.GO24286@brightrain.aerifal.cx> Xref: news.gmane.org gmane.linux.lib.musl.general:4306 Archived-At: > OK, so how do we detect if the system "has IPv6"? I don't think it's > an easy question to answer, but it's not just a rhetorical question > either since we need to know for the AI_ADDRCONFIG flag that's not yet > working, so this may very well be the right way to go. Is there any problem with a build-time test that opens an IPv6 socket ? This is what skalibs does and it's been working so far. Of course, any build-time test makes cross-compilation difficult, but this is why we have configure options, to manually bypass auto-detection when it cannot be relied on. > One other option that's of course the safest is just opening two > sockets, one for IPv4 and one for IPv6, if both are needed, but that > of course complicates, bloats, and slows down the code and adds > failure cases so I'd rather avoid it. s6-dns opens a different UDP socket, with the appropriate address family, every time the client changes servers: so the underlying transport matches exactly what /etc/resolv.conf specifies. You may call it bloated, but I believe it does just the right thing (and I'm not one to go for unnecessary features at the expense of simplicity). Speed is not an issue here, because we're performing network calls: opening sockets is totally negligible compared to waiting for the network anyway. -- Laurent