From martin@email.aon.at  Fri May  9 23:28:32 2003
Return-Path: <martin@email.aon.at>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 28FD637B401
	for <FreeBSD-gnats-submit@freebsd.org>; Fri,  9 May 2003 23:28:32 -0700 (PDT)
Received: from email04.aon.at (WARSL401PIP5.highway.telekom.at [195.3.96.90])
	by mx1.FreeBSD.org (Postfix) with SMTP id 7E7D543FAF
	for <FreeBSD-gnats-submit@freebsd.org>; Fri,  9 May 2003 23:28:30 -0700 (PDT)
	(envelope-from martin@email.aon.at)
Received: (qmail 242078 invoked from network); 10 May 2003 06:28:27 -0000
Received: from m032p003.adsl.highway.telekom.at (HELO gandalf.xyzzy) ([62.47.171.227]) (envelope-sender <martin@email.aon.at>)
          by qmail4rs.highway.telekom.at (qmail-ldap-1.03) with SMTP
          for <FreeBSD-gnats-submit@freebsd.org>; 10 May 2003 06:28:27 -0000
Received: from gandalf.xyzzy (localhost.xyzzy [127.0.0.1])
	by gandalf.xyzzy (8.12.8p1/8.12.8) with ESMTP id h4A6SGUg000908;
	Sat, 10 May 2003 08:28:16 +0200 (CEST)
	(envelope-from martin@gandalf.xyzzy)
Received: (from martin@localhost)
	by gandalf.xyzzy (8.12.8p1/8.12.8/Submit) id h4A6SEAN000907;
	Sat, 10 May 2003 08:28:14 +0200 (CEST)
Message-Id: <200305100628.h4A6SEAN000907@gandalf.xyzzy>
Date: Sat, 10 May 2003 08:28:14 +0200 (CEST)
From: Martin Birgmeier <nobody@nowhere.org>
Reply-To: Martin Birgmeier <nobody@nowhere.org>
To: FreeBSD-gnats-submit@freebsd.org, martin@gandalf.xyzzy
Cc:
Subject: typos in dig & nslookup sources prevent correct IPv6 address lookup
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         52021
>Category:       bin
>Synopsis:       typos in dig & nslookup sources prevent correct IPv6 address lookup
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    dougb
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri May 09 23:30:12 PDT 2003
>Closed-Date:    Sat May 10 16:57:29 PDT 2003
>Last-Modified:  Sat May 10 16:57:29 PDT 2003
>Originator:     Martin Birgmeier
>Release:        FreeBSD 4.8-RELEASE i386
>Organization:
MBi at home
>Environment:
System: FreeBSD gandalf.xyzzy 4.8-RELEASE FreeBSD 4.8-RELEASE #0: Sat Apr 5 13:16:25 CEST 2003 root@gandalf.xyzzy:/d/6s4e/OBJ/FreeBSD/RELENG_4_8_0_RELEASE/src/sys/GANDALF i386


>Description:
	typos in dig & nslookup sources prevent correct IPv6 address lookup

>How-To-Repeat:
	run the command
		nslookup -debug fec0:0:0:4d42::6
	and observe the debugging output to find that the query is mangled

>Fix:
	use the following patch:
============================== cut here ==============================
*** contrib/bind/bin/dig/dig.c.ORIG	Sun Jul  7 10:19:12 2002
--- contrib/bind/bin/dig/dig.c	Fri May  9 23:32:54 2003
***************
*** 1799,1805 ****
  		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[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);
--- 1799,1805 ----
  		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[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);
*** contrib/bind/bin/nslookup/getinfo.c.ORIG	Fri May  9 23:33:56 2003
--- contrib/bind/bin/nslookup/getinfo.c	Fri May  9 23:33:57 2003
***************
*** 945,951 ****
  		      p[9] & 0xf, (p[9] >> 4) & 0xf,
  		      p[8] & 0xf, (p[8] >> 4) & 0xf,
  		      p[7] & 0xf, (p[7] >> 4) & 0xf,
! 		      p[6] & 0xf, (p[4] >> 4) & 0xf,
  		      p[5] & 0xf, (p[5] >> 4) & 0xf,
  		      p[4] & 0xf, (p[4] >> 4) & 0xf,
  		      p[3] & 0xf, (p[3] >> 4) & 0xf,
--- 945,951 ----
  		      p[9] & 0xf, (p[9] >> 4) & 0xf,
  		      p[8] & 0xf, (p[8] >> 4) & 0xf,
  		      p[7] & 0xf, (p[7] >> 4) & 0xf,
! 		      p[6] & 0xf, (p[6] >> 4) & 0xf,
  		      p[5] & 0xf, (p[5] >> 4) & 0xf,
  		      p[4] & 0xf, (p[4] >> 4) & 0xf,
  		      p[3] & 0xf, (p[3] >> 4) & 0xf,
***************
*** 965,971 ****
  		      p[9] & 0xf, (p[9] >> 4) & 0xf,
  		      p[8] & 0xf, (p[8] >> 4) & 0xf,
  		      p[7] & 0xf, (p[7] >> 4) & 0xf,
! 		      p[6] & 0xf, (p[4] >> 4) & 0xf,
  		      p[5] & 0xf, (p[5] >> 4) & 0xf,
  		      p[4] & 0xf, (p[4] >> 4) & 0xf,
  		      p[3] & 0xf, (p[3] >> 4) & 0xf,
--- 965,971 ----
  		      p[9] & 0xf, (p[9] >> 4) & 0xf,
  		      p[8] & 0xf, (p[8] >> 4) & 0xf,
  		      p[7] & 0xf, (p[7] >> 4) & 0xf,
! 		      p[6] & 0xf, (p[6] >> 4) & 0xf,
  		      p[5] & 0xf, (p[5] >> 4) & 0xf,
  		      p[4] & 0xf, (p[4] >> 4) & 0xf,
  		      p[3] & 0xf, (p[3] >> 4) & 0xf,
============================== cut here ==============================
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->analyzed 
State-Changed-By: dougb 
State-Changed-When: Sat May 10 14:13:39 PDT 2003 
State-Changed-Why:  

Before I forget, please pick more reasonable priorities for your 
PR's in the future. 

As for the bugs you reported, the dig problem is well known, fixed 
in the next version of BIND, and has been patched in the port for 
ages now. The nslookup problem is previously undiscovered, but you 
shouldn't be using nslookup anyway. :) Seriously though, I will report 
this to the BIND folks and once it's confirmed I'll patch the port. I 
don't plan to do anything in the tree since hopefully the new 8.4.0 
release of BIND will be cut soon, so I'll just import that. 


Responsible-Changed-From-To: freebsd-bugs->dougb 
Responsible-Changed-By: dougb 
Responsible-Changed-When: Sat May 10 14:13:39 PDT 2003 
Responsible-Changed-Why:  

I'm the nominal BIND maintainer. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=52021 
State-Changed-From-To: analyzed->closed 
State-Changed-By: dougb 
State-Changed-When: Sat May 10 16:56:51 PDT 2003 
State-Changed-Why:  

Mail to originator bounces, so I'll simply handle this as described. 

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