standards/114910: getaddrinfo() fails to set ai_canonname
Mark Andrews
Mark_Andrews at isc.org
Wed Aug 1 06:10:08 UTC 2007
The following reply was made to PR standards/114910; it has been noted by GNATS.
From: Mark Andrews <Mark_Andrews at isc.org>
To: bug-followup at FreeBSD.org, marka at isc.org
Cc:
Subject: Re: standards/114910: getaddrinfo() fails to set ai_canonname
Date: Wed, 01 Aug 2007 16:09:09 +1000
This is a multi-part message in MIME format.
--------------030507020508000005080008
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
--------------030507020508000005080008
Content-Type: text/plain;
name="diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="diff"
Index: lib/libc/net/getaddrinfo.c
===================================================================
RCS file: /home/ncvs/src/lib/libc/net/getaddrinfo.c,v
retrieving revision 1.69.2.9
diff -u -r1.69.2.9 getaddrinfo.c
--- lib/libc/net/getaddrinfo.c 30 Jul 2006 06:11:43 -0000 1.69.2.9
+++ lib/libc/net/getaddrinfo.c 1 Aug 2007 06:06:46 -0000
@@ -1727,8 +1727,11 @@
cur->ai_next = get_ai(&ai, afd, (const char *)cp);
if (cur->ai_next == NULL)
had_error++;
- while (cur && cur->ai_next)
+ while (cur && cur->ai_next) {
+ (void)get_canonname(pai, cur->ai_next,
+ canonname ? canonname : qname);
cur = cur->ai_next;
+ }
cp += n;
break;
default:
@@ -1751,10 +1754,6 @@
}
}
#endif /*RESOLVSORT*/
- if (!canonname)
- (void)get_canonname(pai, sentinel.ai_next, qname);
- else
- (void)get_canonname(pai, sentinel.ai_next, canonname);
RES_SET_H_ERRNO(res, NETDB_SUCCESS);
return sentinel.ai_next;
}
--------------030507020508000005080008--
More information about the freebsd-standards
mailing list