Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 28 Dec 2015 03:27:51 +0000 (UTC)
From:      Hajimu UMEMOTO <ume@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject:   svn commit: r292825 - stable/9/lib/libc/net
Message-ID:  <201512280327.tBS3RpEf022198@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ume
Date: Mon Dec 28 03:27:51 2015
New Revision: 292825
URL: https://svnweb.freebsd.org/changeset/base/292825

Log:
  MFC r292539:
    If we end up following a CNAME chain that does not find
    any data return that instead of internal error.
  
  PR:		156684

Modified:
  stable/9/lib/libc/net/getaddrinfo.c
Directory Properties:
  stable/9/lib/libc/   (props changed)

Modified: stable/9/lib/libc/net/getaddrinfo.c
==============================================================================
--- stable/9/lib/libc/net/getaddrinfo.c	Mon Dec 28 03:26:16 2015	(r292824)
+++ stable/9/lib/libc/net/getaddrinfo.c	Mon Dec 28 03:27:51 2015	(r292825)
@@ -2161,7 +2161,11 @@ getanswer(const querybuf *answer, int an
 		return sentinel.ai_next;
 	}
 
-	RES_SET_H_ERRNO(res, NO_RECOVERY);
+	/*
+	 * We could have walked a CNAME chain, but the ultimate target
+	 * may not have what we looked for.
+	 */
+	RES_SET_H_ERRNO(res, ntohs(hp->ancount) > 0 ? NO_DATA : NO_RECOVERY);
 	return NULL;
 }
 
@@ -2338,6 +2342,7 @@ _dns_getaddrinfo(void *rv, void *cb_data
 	if (sentinel.ai_next == NULL)
 		switch (res->res_h_errno) {
 		case HOST_NOT_FOUND:
+		case NO_DATA:
 			return NS_NOTFOUND;
 		case TRY_AGAIN:
 			return NS_TRYAGAIN;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201512280327.tBS3RpEf022198>