Subject: misc/18193: `dig -x ipv6addr' generates wrong reverse domains
To: None <gnats-bugs@gnats.netbsd.org>
From: None <kawamoto@tenjin.org>
List: netbsd-bugs
Date: 09/06/2002 13:38:31
>Number:         18193
>Category:       misc
>Synopsis:       `dig -x ipv6addr' generates wrong reverse domains
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    misc-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Sep 05 21:40:01 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     KAWAMOTO Yosihisa
>Release:        NetBSD 1.6G (2002/09/04)
>Organization:
	tenjin.org
>Environment:
System: NetBSD sally.tenjin.org 1.6G NetBSD 1.6G (SALLY) #69: Tue Sep 3 09:15:07 JST 2002 kawamoto@sally.tenjin.org:/var/src/sys/arch/i386/compile/SALLY i386
Architecture: i386
Machine: i386
>Description:
	`dig -x ipv6addr' generates wrong reverse domains.
	See `Fix:'.

>How-To-Repeat:
$ dig -x 2001:200:0:1802::ff01
[snip]
;; QUERY SECTION:
;;	1.0.f.f.0.0.0.0.0.0.0.0.0.0.0.0.2.0.8.1.0.0.0.0.-- not 0 but --8.0.2.0.1.0.0.2.ip6.arpa, type = ANY, class = IN
[snip]

>Fix:
--- /usr/src/dist/bind/bin/dig/dig.c	Sat Jun 22 13:59:08 2002
+++ /tmp/dig.c	Fri Sep  6 13:21:51 2002
@@ -1801,7 +1801,7 @@
 		in6->s6_addr[6] & 0x0f, (in6->s6_addr[6] >> 4) & 0x0f,
 		in6->s6_addr[5] & 0x0f, (in6->s6_addr[5] >> 4) & 0x0f,
 		in6->s6_addr[4] & 0x0f, (in6->s6_addr[4] >> 4) & 0x0f,
-		in6->s6_addr[6] & 0x0f, (in6->s6_addr[3] >> 4) & 0x0f,
+		in6->s6_addr[3] & 0x0f, (in6->s6_addr[3] >> 4) & 0x0f,
 		in6->s6_addr[2] & 0x0f, (in6->s6_addr[2] >> 4) & 0x0f,
 		in6->s6_addr[1] & 0x0f, (in6->s6_addr[1] >> 4) & 0x0f,
 		in6->s6_addr[0] & 0x0f, (in6->s6_addr[0] >> 4) & 0x0f);
>Release-Note:
>Audit-Trail:
>Unformatted: