From sec@42.org  Mon Jul 14 01:23:28 2003
Return-Path: <sec@42.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id B12D737B401
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 14 Jul 2003 01:23:28 -0700 (PDT)
Received: from ice.42.org (ice.42.org [194.246.250.222])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 1EA9743F85
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 14 Jul 2003 01:23:28 -0700 (PDT)
	(envelope-from sec@42.org)
Received: by ice.42.org (Postfix, from userid 1000)
	id 48D581C8BE; Mon, 14 Jul 2003 10:23:26 +0200 (CEST)
Message-Id: <20030714082326.48D581C8BE@ice.42.org>
Date: Mon, 14 Jul 2003 10:23:26 +0200 (CEST)
From: Stefan `Sec` Zehl <sec@42.org>
Reply-To: Stefan `Sec` Zehl <sec@42.org>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: dig -x with ipv6-address is broken.
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         54464
>Category:       bin
>Synopsis:       dig -x with ipv6-address is broken.
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    dougb
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Jul 14 01:30:20 PDT 2003
>Closed-Date:    Mon Aug 25 23:40:36 PDT 2003
>Last-Modified:  Mon Aug 25 23:40:36 PDT 2003
>Originator:     Stefan `Sec` Zehl
>Release:        FreeBSD 4.8-STABLE i386
>Organization:
>Environment:
System: FreeBSD ice 4.8-STABLE FreeBSD 4.8-STABLE #2: Sat Jul 5 19:52:29 CEST 2003 root@ice:/export/obj/export/src/sys/ICE i386

FreeBSD 4.8-STABLE from last week.

>Description:

dig -x <v6addr> should convert the address to .ip6.arpa notation
before looking it up.

However this code has a bug, and does this incorrectly

>How-To-Repeat:

| ice:~>dig +qu -x 2001:608:8:0:0:0:0:1
| 
[...]
| ;; QUERY SECTION:
| ;;
| 1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.8.0.0.0.0.0.6.0.1.0.0.2.ip6.arpa, type = ANY, class = IN

There is clearly one '8' missing, the correct string should be:

1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.8.0.0.0.8.0.6.0.1.0.0.2.ip6.arpa

from googling, this appears to have already been fixed in the bind-8.4.0
release.

>Fix:

a simple cut&paste error in reverse6();

--- contrib/bind/bin/dig/dig.c.org	Fri Jul 12 12:24:59 2002
+++ contrib/bind/bin/dig/dig.c	Mon Jul 14 10:15:17 2003
@@ -1799,7 +1799,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:
State-Changed-From-To: open->closed 
State-Changed-By: kris 
State-Changed-When: Mon Jul 14 04:37:20 PDT 2003 
State-Changed-Why:  
BIND is maintained externally to FreeBSD.  Please report 
this to the BIND developers instead. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=54464 
State-Changed-From-To: closed->open 
State-Changed-By: kris 
State-Changed-When: Mon Jul 14 04:48:49 PDT 2003 
State-Changed-Why:  
This is already fixed in 8.4.0, submitter enquires whether 
that will be imported into -stable. 


Responsible-Changed-From-To: freebsd-bugs->dougb 
Responsible-Changed-By: kris 
Responsible-Changed-When: Mon Jul 14 04:48:49 PDT 2003 
Responsible-Changed-Why:  
Assign to BIND maintainer 

http://www.freebsd.org/cgi/query-pr.cgi?pr=54464 
State-Changed-From-To: open->closed 
State-Changed-By: dougb 
State-Changed-When: Mon Aug 25 23:40:11 PDT 2003 
State-Changed-Why:  

The same fix is present in 8.3.6, which I just MFC'ed 

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