summaryrefslogtreecommitdiffstats
path: root/lib/libc/net
diff options
context:
space:
mode:
authorache <ache@FreeBSD.org>1997-01-08 13:06:14 +0000
committerache <ache@FreeBSD.org>1997-01-08 13:06:14 +0000
commitbf70ac7d48b1d04e4034ae5559d632caba564706 (patch)
treeb7f48d87f9a53795a83718783d1a6fc2b1e87bf3 /lib/libc/net
parent6ed07ccb5b543be02ab260ca6258877aae01e975 (diff)
downloadFreeBSD-src-bf70ac7d48b1d04e4034ae5559d632caba564706.zip
FreeBSD-src-bf70ac7d48b1d04e4034ae5559d632caba564706.tar.gz
Fix fake failures on the short names which looks like hexadecimal numbers
Submitted by: paul@vix.com
Diffstat (limited to 'lib/libc/net')
-rw-r--r--lib/libc/net/gethostbydns.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/lib/libc/net/gethostbydns.c b/lib/libc/net/gethostbydns.c
index 9a07a45..f77e013 100644
--- a/lib/libc/net/gethostbydns.c
+++ b/lib/libc/net/gethostbydns.c
@@ -56,7 +56,7 @@
#if defined(LIBC_SCCS) && !defined(lint)
static char sccsid[] = "@(#)gethostnamadr.c 8.1 (Berkeley) 6/4/93";
static char fromrcsid[] = "From: Id: gethnamaddr.c,v 8.20 1996/09/28 06:51:07 vixie Exp";
-static char rcsid[] = "$Id: gethostbydns.c,v 1.16 1996/12/30 13:18:37 peter Exp $";
+static char rcsid[] = "$Id: gethostbydns.c,v 1.17 1997/01/05 17:26:09 ache Exp $";
#endif /* LIBC_SCCS and not lint */
#include <sys/types.h>
@@ -497,12 +497,8 @@ _gethostbydnsname(name, af)
if (!isdigit(*cp) && *cp != '.')
break;
}
-/*
- * XXX: isxdigit(name[0]) gives false failures on short names which looks
- * like hexadecimal digits, f.e. "fade", "babe", "d133", etc.
- */
-#if 0
- if (isxdigit(name[0]) || name[0] == ':')
+ if ((isxdigit(name[0]) && strchr(name, ':') != NULL) ||
+ name[0] == ':')
for (cp = name;; ++cp) {
if (!*cp) {
if (*--cp == '.')
@@ -532,7 +528,7 @@ _gethostbydnsname(name, af)
if (!isxdigit(*cp) && *cp != ':' && *cp != '.')
break;
}
-#endif /* XXX */
+
if ((n = res_search(name, C_IN, type, buf.buf, sizeof(buf))) < 0) {
dprintf("res_search failed (%d)\n", n);
return (NULL);
OpenPOWER on IntegriCloud