From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/5180 Path: news.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: Resolver overhaul started Date: Fri, 30 May 2014 21:56:04 -0400 Message-ID: <20140531015604.GD507@brightrain.aerifal.cx> References: <20140530044105.GU507@brightrain.aerifal.cx> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1401501387 25958 80.91.229.3 (31 May 2014 01:56:27 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 31 May 2014 01:56:27 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-5185-gllmg-musl=m.gmane.org@lists.openwall.com Sat May 31 03:56:20 2014 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 1WqYWy-0005GU-6g for gllmg-musl@plane.gmane.org; Sat, 31 May 2014 03:56:20 +0200 Original-Received: (qmail 7744 invoked by uid 550); 31 May 2014 01:56:18 -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 7730 invoked from network); 31 May 2014 01:56:17 -0000 Content-Disposition: inline In-Reply-To: <20140530044105.GU507@brightrain.aerifal.cx> User-Agent: Mutt/1.5.21 (2010-09-15) Original-Sender: Rich Felker Xref: news.gmane.org gmane.linux.lib.musl.general:5180 Archived-At: On Fri, May 30, 2014 at 12:41:06AM -0400, Rich Felker wrote: > I've started working on the resolver overhaul with a design based on > what I described in the thread "Resolver overhaul concepts". The code And now I have a working implementation of everything the old getaddrinfo did except dns lookups, plus support for returning both tcp and udp service results for the same query, and accepting service aliases. One big open question is if/how we should implement the rfc 3484 stuff for sorting results. In principle it's easy to do now since the refactoring gives us a nice list of results that can be sorted before the output is produced, but I don't understand the way the rules are intended to be applied at all. It looks to me like lots of them require consulting the routing table -- this can probably be done with udp and socket+bind+connect+getsockname to determine the local address that would be used to send to a given remote address, without actually sending any packets, but doing so may be measurably slow. Also note that qsort isn't a good choice for the sorting since the rfc seems to demand a stable sort; fortunately the set size is so small that naive sorts should be fine. I still need to work out the best factoring for dns code so that it's useful for both the legacy res_* and dn_* stuff and the massively parallel lookups we want for getaddrinfo. I'll probably work on this next since I can't really commit anything to master until there are no obvious feature regressions. Rich