| Summary: | ip6fw error under DNS dislabled environment | ||||||
|---|---|---|---|---|---|---|---|
| Product: | Base System | Reporter: | Yuichi SHIMODA <shimoda> | ||||
| Component: | bin | Assignee: | Crist J. Clark <cjc> | ||||
| Status: | Closed FIXED | ||||||
| Severity: | Affects Only Me | ||||||
| Priority: | Normal | ||||||
| Version: | 4.4-STABLE | ||||||
| Hardware: | Any | ||||||
| OS: | Any | ||||||
| Attachments: |
|
||||||
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 State Changed From-To: open->analyzed This is a bug. Responsible Changed From-To: freebsd-bugs->cjc 'Bout time someone fixed this. State Changed From-To: analyzed->patched Fixed in -CURRENT. Will MFC in three days. State Changed From-To: patched->closed MFC'ed. |
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] : : How-To-Repeat: edit your /etc/host.conf: hosts # bind <-- commented out # nis use ip6fw command: ip6fw add allow ipv6-icmp from ff02::/16 to ::