From d5316210dc9e14015fa84f0358d2e1296776dc0a Mon Sep 17 00:00:00 2001 From: Jason Wright Date: Mon, 17 Mar 2003 23:16:37 +0000 Subject: If hostname != NULL, hostname is not a numeric string, and AI_NUMERICHOST is set, return EAI_NONAME like RFC2553 specifies. millert/itojun ok. --- lib/libc/net/getaddrinfo.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/libc') diff --git a/lib/libc/net/getaddrinfo.c b/lib/libc/net/getaddrinfo.c index 241c5b17aee..490b9861ae5 100644 --- a/lib/libc/net/getaddrinfo.c +++ b/lib/libc/net/getaddrinfo.c @@ -1,4 +1,4 @@ -/* $OpenBSD: getaddrinfo.c,v 1.45 2003/03/04 00:29:17 itojun Exp $ */ +/* $OpenBSD: getaddrinfo.c,v 1.46 2003/03/17 23:16:36 jason Exp $ */ /* $KAME: getaddrinfo.c,v 1.31 2000/08/31 17:36:43 itojun Exp $ */ /* @@ -435,10 +435,10 @@ getaddrinfo(hostname, servname, hints, res) if (sentinel.ai_next) goto good; - if (pai->ai_flags & AI_NUMERICHOST) - ERR(EAI_NODATA); if (hostname == NULL) ERR(EAI_NODATA); + if (pai->ai_flags & AI_NUMERICHOST) + ERR(EAI_NONAME); /* * hostname as alphabetical name. -- cgit v1.2.3