Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 15 Nov 2001 02:50:01 -0800 (PST)
From:      "Crist J. Clark" <cristjc@earthlink.net>
To:        freebsd-bugs@FreeBSD.org
Subject:   Re: bin/31632: ip6fw error under DNS dislabled environment
Message-ID:  <200111151050.fAFAo1x21329@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR bin/31632; it has been noted by GNATS.

From: "Crist J. Clark" <cristjc@earthlink.net>
To: Yuichi SHIMODA <shimoda@rcac.tdi.co.jp>
Cc: FreeBSD-gnats-submit@FreeBSD.ORG
Subject: Re: bin/31632: ip6fw error under DNS dislabled environment
Date: Thu, 15 Nov 2001 02:43:06 -0800

 On Tue, Oct 30, 2001 at 07:02:54PM +0900, Yuichi SHIMODA wrote:
 [snip]
 
 > >Description:
 > when my /etc/host.conf contains no "bind" entries,
 > ip6fw command with ipv6 address argument shows error message.
 > 
 >   ip6fw: error: hostname ``ff02::'' unknown
 >   usage: ip6fw [options]
 >     :
 >     :
 
 This bug was fixed in ipfw(8) long ago. There must be a way to keep
 these two in better sync (like, should they really be separate code
 bases?).
 
 This patch is more in sync with the current ipfw.c way to do this,
 
 Index: ip6fw.c
 ===================================================================
 RCS file: /export/ncvs/src/sbin/ip6fw/ip6fw.c,v
 retrieving revision 1.8
 diff -u -r1.8 ip6fw.c
 --- ip6fw.c	28 Oct 2001 20:19:14 -0000	1.8
 +++ ip6fw.c	15 Nov 2001 10:41:00 -0000
 @@ -515,15 +515,15 @@
  static int
  lookup_host (host, addr, family)
  	char *host;
 -	u_char *addr;
 +	struct in6_addr *addr;
  {
 -	struct hostent *he = gethostbyname2(host, family);
 -
 -	if (!he)
 -		return(-1);
 -
 -	memcpy(addr, he->h_addr_list[0], he->h_length);
 +	struct hostent *he;
  
 +	if (inet_pton(family, host, addr) != 1) {
 +		if ((he = gethostbyname2(host, family)) == NULL)
 +			return(-1);
 +		*addr = *(struct in6_addr *)he->h_addr_list[0];
 +	}	
  	return(0);
  }
  
 
 -- 
 Crist J. Clark                     |     cjclark@alum.mit.edu
                                    |     cjclark@jhu.edu
 http://people.freebsd.org/~cjc/    |     cjc@freebsd.org

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200111151050.fAFAo1x21329>