From jared@puck.nether.net  Wed Apr 27 19:58:00 2011
Return-Path: <jared@puck.nether.net>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 3FE73106566C
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 27 Apr 2011 19:58:00 +0000 (UTC)
	(envelope-from jared@puck.nether.net)
Received: from puck.nether.net (puck.nether.net [IPv6:2001:418:3f4::5])
	by mx1.freebsd.org (Postfix) with ESMTP id 137C88FC22
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 27 Apr 2011 19:57:59 +0000 (UTC)
Received: from puck.nether.net (puck.nether.net [204.42.254.5])
	by puck.nether.net (8.14.4/8.12.9) with ESMTP id p3RJvxO8028811
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 27 Apr 2011 15:57:59 -0400 (EDT)
	(envelope-from jared@puck.nether.net)
Received: (from jared@localhost)
	by puck.nether.net (8.14.4/8.12.9/Submit) id p3RJvxLc028810;
	Wed, 27 Apr 2011 15:57:59 -0400 (EDT)
	(envelope-from jared)
Message-Id: <201104271957.p3RJvxLc028810@puck.nether.net>
Date: Wed, 27 Apr 2011 15:57:59 -0400 (EDT)
From: Jared Mauch <jared@puck.nether.net>
Reply-To: Jared Mauch <jared@puck.nether.net>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: getaddrinfo returns improper error
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         156684
>Category:       kern
>Synopsis:       [libc] getaddrinfo(3) returns improper error
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Apr 27 20:00:19 UTC 2011
>Closed-Date:    
>Last-Modified:  Tue Jul 12 16:10:10 UTC 2011
>Originator:     Jared Mauch
>Release:        FreeBSD 8.1-RELEASE-p1 i386
>Organization:
self
>Environment:
System: FreeBSD puck.nether.net 8.1-RELEASE-p1 FreeBSD 8.1-RELEASE-p1 #0: Thu Nov 4 15:59:47 UTC 2010 jared@newjail2.nether.net:/usr/src/sys/i386/compile/PAE i386


Description:
	% ping6 www.apple.com
	ping6: Non-recoverable failure in name resolution

	The name does properly resolve for AAAA with NOERROR and should
come back with a "hostname nor servname provided, or not known" instead

How-To-Repeat:
	% ping6 www.apple.com

	The same can be done with source code that goes a getaddrinfo().  
ping6 is just an easy way to reproduce.  I have 450k other domain names 
that return a similar error that are improper.

Fix:

	Unknown.  A dig/host of the domains does not seem to find this error.
A domain that should return this type of error is www qq com as their
nameserver is doing something 'odd'.


>Description:
>How-To-Repeat:
>Fix:
>Release-Note:
>Audit-Trail:

From: Doug White <dwhite@gumbysoft.com>
To: bug-followup@FreeBSD.org,
 jared@puck.nether.net
Cc:  
Subject: Re: bin/156684: getaddrinfo returns improper error
Date: Wed, 27 Apr 2011 18:23:12 -0700

 Hello Jared,
 
 Thanks for your bug report.
 
 It appears the resolver makes a distinction between a record resolves to =
 a CNAME that points to another record that does not have a AAAA entry, =
 versus a record that has no AAAA or CNAME at all. This behavior is =
 consistent with A records as well.
 
 To test this, I created these RRs in gumbysoft.com (these are real so =
 you can test this as well):
 
 aaaatest                    AAAA    2001:4f8:fff6::22
 cnametoaaaa             CNAME   ipv6
 cnametononaaaa          CNAME   carver
 
 The IPv6 address is the same as www.freebsd.org so it should respond to =
 pings. carver is my machine that is IPv4-only. (Note to old bugbase =
 readers: These records are subject to change without notice to this =
 bug.)
 
 I am going to test from freefall.freebsd.org, which is dual stack, =
 running a recent FreeBSD 8-STABLE build.
 
 FreeBSD freefall.freebsd.org 8.2-STABLE FreeBSD 8.2-STABLE #4 r220774: =
 Mon Apr 18 13:56:14 UTC 2011     =
 simon@freefall.freebsd.org:/usr/obj/usr/src/sys/FREEFALL  i386
 
 'ping6 aaaatest.gumbysoft.com' and 'ping6 cnametoaaaa.gumbysoft.com' =
 resolve successfully, but 'ping6 cnametononaaaa.gumbysoft.com', a =
 dangling CNAME, fails:
 
 freefall,pts/9,~,36>ping6 cnametononaaaa.gumbysoft.com
 ping6: Non-recoverable failure in name resolution
 
 and names with no AAAA or simply nonexistent names return:
 
 freefall,pts/9,~,37>ping6 blabla.gumbysoft.com
 ping6: hostname nor servname provided, or not known
 freefall,pts/9,~,14>ping6 carver.gumbysoft.com
 ping6: hostname nor servname provided, or not known
 
 By comparison, on A records, where cnametoaaaa does not point to an =
 existent A entry (using telnet -4 so it uses getaddrinfo()):
 
 freefall,pts/9,~,42>telnet -4 blabla.gumbysoft.com
 blabla.gumbysoft.com: hostname nor servname provided, or not known
 freefall,pts/9,~,43>telnet -4 cnametoaaaa.gumbysoft.com
 cnametoaaaa.gumbysoft.com: Non-recoverable failure in name resolution
 
 Research into the issue seems to come down to a philosophical argument =
 as to whether to report "danging" CNAMEs as a separate problem from =
 simply nonexistent records.=20
 
 At this point, though, the reported issue is simply not a bug; an error =
 is returned on an attempt to resolve an unresolvable address/type =
 combination. Which error is reported is dependent on the precise failure =
 mode, but the result is the same: failure to resolve the requested name =
 to an address.
 
 

From: Doug Barton <dougb@dougbarton.us>
To: bug-followup@FreeBSD.org, jared@puck.nether.net
Cc:  
Subject: Re: bin/156684: getaddrinfo returns improper error
Date: Thu, 28 Apr 2011 13:33:46 -0700

 I hate to disagree with my esteemed colleague, :) however I think in the 
 case where the name server does not return an error (such as servfail or 
 nxdomain) the proper response for getaddrinfo() is EAI_NONAME. The 
 thread at 
 https://lists.isc.org/pipermail/bind-users/2011-April/083542.html has a 
 good discussion about why.
 
 
 Doug
 
 -- 
 
 	Nothin' ever doesn't change, but nothin' changes much.
 			-- OK Go
 
 	Breadth of IT experience, and depth of knowledge in the DNS.
 	Yours for the right price.  :)  http://SupersetSolutions.com/
 

From: Jared Mauch <jared@puck.nether.net>
To: bug-followup@FreeBSD.org, jared@puck.nether.net
Cc:  
Subject: Re: kern/156684: [libc] getaddrinfo(3) returns improper error
Date: Tue, 12 Jul 2011 12:03:35 -0400

 Is this slated for fix in 9.0?
>Unformatted:
