Subject: lib/3535: resolver broken in current of 19970424
To: None <>
From: Daniel Hagerty <>
List: netbsd-bugs
Date: 04/24/1997 19:50:49
>Number:         3535
>Category:       lib
>Synopsis:       current resolver has problems with hostnames that are
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    lib-bug-people (Library Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Apr 24 17:05:03 1997
>Release:        NetBSD-current 19970424
System: NetBSD 1.2D NetBSD 1.2D (REPO_MAN) #36: Thu Apr 24 13:23:17 EDT 1997 i386

	The current resolver library is somewhat broken.  I have
several machines with two letter CNAMEs and several of them broke
today, i.e:

$ host bc       	CNAME	A
$ ping bc
ping: Cannot resolve host `bc' (Unknown host)
[exit 1]

	Haven't looked at the code to make a good simple test case;
but if you have problems reproducing it I'm happy to hand out accounts
on my box.
	The problem chunk of code is gethostnamaddr.c around line 512
or so, this chunk of code; I don't have a fix:

	if (isxdigit(name[0]) || name[0] == ':')
		for (cp = name;; ++cp) {
			if (!*cp) {
				if (*--cp == '.')
				 * All-IPv6-legal, no dot at the end.
				 * Fake up a hostent as if we'd actually
				 * done a lookup.
				if (inet_pton(af, name, host_addr) <= 0) {
					h_errno = HOST_NOT_FOUND;
					return (NULL);
		all hex digits