Subject: lib/3535: resolver broken in current of 19970424
To: None <gnats-bugs@gnats.netbsd.org>
From: Daniel Hagerty <hag@ai.mit.edu>
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
>Last-Modified:
>Originator:     
>Organization:
>Release:        NetBSD-current 19970424
>Environment:
	
System: NetBSD repo-man.ai.mit.edu 1.2D NetBSD 1.2D (REPO_MAN) #36: Thu Apr 24 13:23:17 EDT 1997 hag@repo-man.ai.mit.edu:/fs/repo/hag/work/hacking/os/netbsd/src/sys/arch/i386/compile/REPO_MAN i386


>Description:
	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
bc.ai.mit.edu       	CNAME	beet-chex.ai.mit.edu
beet-chex.ai.mit.edu	A	128.52.32.22
$ ping bc
ping: Cannot resolve host `bc' (Unknown host)
[exit 1]
$ 

>How-To-Repeat:
	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.
>Fix:
	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 == '.')
					break;
				/*
				 * 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);
				}
>Audit-Trail:
>Unformatted:
		all hex digits