From root@turing.morons.org  Mon Jan 22 17:49:10 2007
Return-Path: <root@turing.morons.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id A206516A400
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 22 Jan 2007 17:49:10 +0000 (UTC)
	(envelope-from root@turing.morons.org)
Received: from turing.morons.org (morons.org [64.147.161.226])
	by mx1.freebsd.org (Postfix) with ESMTP id 9554F13C442
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 22 Jan 2007 17:49:10 +0000 (UTC)
	(envelope-from root@turing.morons.org)
Received: by turing.morons.org (Postfix, from userid 0)
	id 4952117036; Mon, 22 Jan 2007 09:51:37 -0800 (PST)
Message-Id: <20070122175137.4952117036@turing.morons.org>
Date: Mon, 22 Jan 2007 09:51:37 -0800 (PST)
From: Nick Johnson <freebsd@spatula.net>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: ipv6 broken in 6.2 
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         108216
>Category:       kern
>Synopsis:       IPv6 over gif(4) broken in 6.2
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    bmah
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Jan 22 17:50:19 GMT 2007
>Closed-Date:    Fri Feb 09 01:54:44 GMT 2007
>Last-Modified:  Fri Feb 09 01:54:44 GMT 2007
>Originator:     Nick Johnson
>Release:        FreeBSD 6.2-STABLE i386
>Organization:
morons.org 
>Environment:
System: FreeBSD turing.morons.org 6.2-STABLE FreeBSD 6.2-STABLE #0: Sun Jan 21 16:53:54 PST 2007 root@turing.morons.org:/usr/src/sys/i386/compile/TURING i386


	
>Description:


IPv6 in FreeBSD 6.2-RELEASE and -STABLE as of this writing is broken.  The symptom is that any attempt to send
a packet results in a "no route to host" message.  This was tested using v6v4 over a gif interface using
freenet6.net (which configures with the tspc daemon).


	
>How-To-Repeat:

Upgrade to 6.2.  Create an ipv6 tunnel with any tunnel broker.  Attempt to ping6 any ipv6 destination.
	
>Fix:

As mentioned in http://lists.freebsd.org/pipermail/freebsd-stable/2006-December/031853.html this problem can
be traced to a single commit.

The workaround is to back out this commit locally, by fetching the diff to the previous commit:

http://www.freebsd.org/cgi/cvsweb.cgi/src/sys/netinet6/nd6.c.diff?r1=1.48.2.15&r2=1.48.2.16

And then doing a patch -R against sys/netinet6/nd6.c , then recompiling the kernel.


At the very least, this bug should be noted in the 6.2 errata (at the time of this writing it still wasn't) since
it is complete breakage of major system functionality.


Visual inspection suggests that the problem may be related to this change:

 			lookup:
-				rt->rt_gwroute = rtalloc1(rt->rt_gateway, 1, 0UL);
-				if ((rt = rt->rt_gwroute) == 0)
+				RT_UNLOCK(rt0);
+				rt = rtalloc1(rt->rt_gateway, 1, 0UL);

Note that the assignment changed from rt->gwroute to rt itself.  This seems suspicious.  Unfortunately I do not
have a test system available at the moment to change this code to see if it corrects the trouble.
	


>Release-Note:
>Audit-Trail:

From: "Bruce A. Mah" <bmah@freebsd.org>
To: bug-followup@freebsd.org, freebsd@spatula.net
Cc:  
Subject: Re: kern/108216: ipv6 broken in 6.2
Date: Mon, 22 Jan 2007 10:34:53 -0800

 This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
 --------------enigA45F6C9C6E3206ACCDFA8789
 Content-Type: text/plain; charset=ISO-8859-1
 Content-Transfer-Encoding: quoted-printable
 
 How can this fix (revert revision 1.48.2.16 of nd6.c) help 6.2-RELEASE
 if that revision isn't even present at the RELENG_6_2_0_RELEASE tag?
 
 tomcat:netinet6% cvs log nd6.c | grep RELENG_6_2_0_RELEASE
         RELENG_6_2_0_RELEASE: 1.48.2.15
 
 (I agree there's a problem, but am not convinced of the diagnosis or the
 fix.)
 
 Bruce.
 
 
 --------------enigA45F6C9C6E3206ACCDFA8789
 Content-Type: application/pgp-signature; name="signature.asc"
 Content-Description: OpenPGP digital signature
 Content-Disposition: attachment; filename="signature.asc"
 
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.6 (Darwin)
 Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
 
 iD8DBQFFtQPN2MoxcVugUsMRAkBeAJ4jpijcTM8uRGzl+LmTf4vs8owCgwCgtKqv
 UxyfKhjF1wRWLTQPM9DDfkU=
 =OGeb
 -----END PGP SIGNATURE-----
 
 --------------enigA45F6C9C6E3206ACCDFA8789--

From: Nick Johnson <freebsd@spatula.net>
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/108216: ipv6 broken in 6.2
Date: Mon, 22 Jan 2007 21:10:26 -0800 (PST)

 It is definitely broken in 6.2-STABLE.  The revision in question bears the 
 RELENG_6 tag.
 
 In any case, it is major breakage that should be fixed.  It shouldn't be 
 broken in -STABLE and left that way either.  Anyone using stable-supfile 
 will be bit by this.

From: "Bruce A. Mah" <bmah@freebsd.org>
To: bug-followup@freebsd.org, freebsd@spatula.net
Cc:  
Subject: Re: kern/108216: ipv6 broken in 6.2
Date: Tue, 23 Jan 2007 19:09:01 -0800

 This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
 --------------enig809B8675A140377938AA1165
 Content-Type: text/plain; charset=ISO-8859-1
 Content-Transfer-Encoding: quoted-printable
 
 This is part of a private email I tried to send but it got bounced.
 
 # Just to follow-up with this:  I finally did an item for the errata
 # document, with a workaround.
 #
 # This is really an odd bug.  The results I am getting via testing are
 # different from what Dimitry Andric is getting (see our thread on net@
 # and stable@).  So while I agree that something needs to be fixed, it's
 # not at all clear given the results we have so far what the fix is.
 #
 # As for the odd code you found...I agree this looks kind of suspicious.
 # I haven't examined the code around it though because I'm still trying t=
 o
 # understand why my fix seems to work for me.
 
 
 
 --------------enig809B8675A140377938AA1165
 Content-Type: application/pgp-signature; name="signature.asc"
 Content-Description: OpenPGP digital signature
 Content-Disposition: attachment; filename="signature.asc"
 
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.6 (Darwin)
 Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
 
 iD8DBQFFts3N2MoxcVugUsMRAvKtAKCWUkIfTjQdSeaEGur+rx04H/2FZACdEs6v
 vhSTTIc1h3epfgzogce3gU4=
 =wFN7
 -----END PGP SIGNATURE-----
 
 --------------enig809B8675A140377938AA1165--
State-Changed-From-To: open->closed 
State-Changed-By: bmah 
State-Changed-When: Fri Feb 9 01:52:44 UTC 2007 
State-Changed-Why:  
Believed fixed (at least in my testing) with src/sys/netinet6/nd6.c 
rev. 1.74 (HEAD) and rev. 1.48.2.18 (RELENG_6).  Note that this is 
a different solution than what was suggested originally in the PR. 



Responsible-Changed-From-To: freebsd-bugs->bmah 
Responsible-Changed-By: bmah 
Responsible-Changed-When: Fri Feb 9 01:52:44 UTC 2007 
Responsible-Changed-Why:  
With some trepidation, take.  I reserve the right to toss this back in 
the pool of free PRs if my solution doesn't solve the issue and I 
get in over my head. 


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