From fenner@fenestro.attlabs.att.com  Sun Jul  9 22:23:00 2000
Return-Path: <fenner@fenestro.attlabs.att.com>
Received: from fenestro.attlabs.att.com (adsl-216-103-84-67.dsl.snfc21.pacbell.net [216.103.84.67])
	by hub.freebsd.org (Postfix) with ESMTP id 076B437B5DF
	for <FreeBSD-gnats-submit@freebsd.org>; Sun,  9 Jul 2000 22:22:59 -0700 (PDT)
	(envelope-from fenner@fenestro.attlabs.att.com)
Received: (from fenner@localhost)
	by fenestro.attlabs.att.com (8.9.3/8.9.3) id WAA15748;
	Sun, 9 Jul 2000 22:22:58 -0700 (PDT)
	(envelope-from fenner)
Message-Id: <200007100522.WAA15748@fenestro.attlabs.att.com>
Date: Sun, 9 Jul 2000 22:22:58 -0700 (PDT)
From: Bill Fenner <fenner@research.att.com>
Sender: fenner@fenestro.attlabs.att.com
Reply-To: fenner@research.att.com
To: FreeBSD-gnats-submit@freebsd.org
Subject: getnameinfo() dumps core on 131.118.32.4
X-Send-Pr-Version: 3.2

>Number:         19816
>Category:       bin
>Synopsis:       getnameinfo() dumps core on 131.118.32.4
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    ume
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Jul 09 22:30:03 PDT 2000
>Closed-Date:    Tue Jul 18 23:22:51 PDT 2000
>Last-Modified:  Tue Jul 18 23:27:30 PDT 2000
>Originator:     Bill Fenner
>Release:        FreeBSD 4.0-STABLE i386
>Organization:
AT&T Labs - Research
>Environment:

	

>Description:

	
getnameinfo() dumps core on 131.118.32.4
It assumes that getipnodebyaddr() can not return an hp->h_name of NULL.
However, it can, with the odd PTR record that 131.118.32.4 has:

4.32.118.131.in-addr.arpa.  1D IN PTR  .

I don't know if this is a bug in getipnodebyaddr() or getnameinfo().

>How-To-Repeat:

	

#include <stdio.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>

int
main(int argc,char **argv)
{
	struct sockaddr_in sin;
	char _hostname[256];

	sin.sin_family = AF_INET;
	sin.sin_len = sizeof(sin);
	sin.sin_addr.s_addr = inet_addr("131.118.32.4");

	getnameinfo((struct sockaddr*)&sin, sin.sin_len,
		      _hostname, sizeof(_hostname) - 1, NULL, 0,
		      NI_NAMEREQD);
}


>Fix:

	
Unknown.
Workaround: don't try to look up this IP address using getnameinfo().


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->shin 
Responsible-Changed-By: sheldonh 
Responsible-Changed-When: Mon Jul 10 05:11:15 PDT 2000 
Responsible-Changed-Why:  
Over to Inoue-san, whose code this seems to be. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=19816 
Responsible-Changed-From-To: shin->ume 
Responsible-Changed-By: sheldonh 
Responsible-Changed-When: Tue Jul 18 07:17:09 PDT 2000 
Responsible-Changed-Why:  
Inoue-san seems unavailable at the moment. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=19816 
State-Changed-From-To: open->closed 
State-Changed-By: ume 
State-Changed-When: Tue Jul 18 23:22:51 PDT 2000 
State-Changed-Why:  
It should be corrected by getipnodebyaddr() side and committed. 
(libc/net/name6.c rev 1.14) 
Thank you for reporting it. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=19816 
>Unformatted:
