From oldwolf@gap.netcore.fi  Tue Mar  4 05:12:55 2003
Return-Path: <oldwolf@gap.netcore.fi>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 11E7B37B401
	for <FreeBSD-gnats-submit@freebsd.org>; Tue,  4 Mar 2003 05:12:55 -0800 (PST)
Received: from gap.netcore.fi (a145d25.elisa.omakaista.fi [212.54.28.145])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 32E5C43FEC
	for <FreeBSD-gnats-submit@freebsd.org>; Tue,  4 Mar 2003 05:12:53 -0800 (PST)
	(envelope-from oldwolf@gap.netcore.fi)
Received: from gap.netcore.fi (oldwolf@localhost [127.0.0.1])
	by gap.netcore.fi (8.12.8/8.12.8) with ESMTP id h24DCnjY000394
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 4 Mar 2003 15:12:50 +0200 (EET)
	(envelope-from oldwolf@gap.netcore.fi)
Received: (from oldwolf@localhost)
	by gap.netcore.fi (8.12.8/8.12.8/Submit) id h24DCnjQ000393;
	Tue, 4 Mar 2003 15:12:49 +0200 (EET)
Message-Id: <200303041312.h24DCnjQ000393@gap.netcore.fi>
Date: Tue, 4 Mar 2003 15:12:49 +0200 (EET)
From: Pekka Savola <pekkas@netcore.fi>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: creating stf 6to4 IPv6 pseudo-interface adds wrong routes
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         48917
>Category:       kern
>Synopsis:       creating stf 6to4 IPv6 pseudo-interface adds wrong routes
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Mar 04 05:20:08 PST 2003
>Closed-Date:    Tue Mar 04 22:57:26 PST 2003
>Last-Modified:  Tue Mar  4 23:00:27 PST 2003
>Originator:     Pekka Savola
>Release:        FreeBSD 4.8-RC i386
>Organization:
-
>Environment:
System: FreeBSD gap.netcore.fi 4.8-RC FreeBSD 4.8-RC #3: Tue Mar 4 09:57:41 EET 2003 root@gap.netcore.fi:/usr/home/share/obj/usr/src/sys/GAP i386
>Description:
There seems to be an issue (since about FreeBSD-4.5, 4.6 or so) that the
IPv6 6to4 "stf" pseudo-interface gets initialized wrong.

I've also brought this up with snap-users@kame.net (even though I don't use
a SNAP) on "Tue, 5 Nov 2002 18:23:23 +0200 (EET)", no help.

I use the 6to4 anycast address (default configuration), and after booting
up, the routing table looks like:

# netstat -nr | grep 2002
default                           2002:c058:6301::              UGSc	stf0
2002::/24                         ::1                           UGRSc	lo0 =>
2002::/16                         2002:d436:1c91::1             Uc	rl0
2002:7f00::/24                    ::1                           UGRSc	lo0
2002:d436:1c91::/64               link#1                        UC	rl0
2002:d436:1c91::1                 00:a0:d2:1a:01:3c             UHL	lo0
2002:e000::/20                    ::1                           UGRSc	lo0
2002:ff00::/24                    ::1                           UGRSc	lo0

The problem is the "2002::/16" interface route.  It points to a physical
interface (the first one), and lists my own address as the gateway.

# route get -inet6 2002::/16
   route to: 2002::
destination: 2002::
       mask: ffff::
  interface: rl0
      flags: <UP,DONE,PRCLONING>
 recvpipe  sendpipe  ssthresh  rtt,msec    rttvar  hopcount      mtu	expire
       0         0         0         0         0         0      1500	0 

The problem can be seen if you try to ping6 another 6to4 address (2002::/16)
which is on-link with all the 6to4 addresses; kernel complains:

nd6_storelladdr: something odd happens

.. and ping6 fails.  Other pings which go through the relay, default route,
work fine.

This can be remedied by deleting the bogus route and adding the correct one
instead:

route add -inet6 2002::/16 -iface stf0

>How-To-Repeat:

Try configuration similar to:

ipv6_ifconfig_rl0="2002:d436:1c91::1 prefixlen 64" # local network
ipv6_network_interfaces="rl0 stf0"
stf_interface_ipv4addr="212.54.28.145"       # Local IPv4 addr for 6to4 IPv6 over IPv4
ipv6_gateway_enable="YES"
ipv6_defaultrouter="2002:c058:6301::"

and ping6 another 6to4 node (e.g. "gap.netcore.fi").

(node that stf_interface_ipv4addr and ipv6_ifconfig_rl0 naturally have to
correspond to your public IPv4 address)

>Fix:

workaround:

route delete -inet6 2002::/16 
route add -inet6 2002::/16 -iface stf0


>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->feedback 
State-Changed-By: dwmalone 
State-Changed-When: Tue Mar 4 13:45:10 PST 2003 
State-Changed-Why:  
Hi Pekka, 

Looking at your config, I see you have: 

ipv6_ifconfig_rl0="2002:d436:1c91::1 prefixlen 64" # local network 

but this address will be assigned to the stf0 interface when it is 
configured. I presume rl0 is being reconfigured after this and the 
IP is being moved (with all its routes) to rl0? 

I think you can give another address to the stf interface by setting: 

stf_interface_ipv6_slaid 

Can you see if this seems to explain what you're seeing? 

David. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=48917 
State-Changed-From-To: feedback->closed 
State-Changed-By: roam 
State-Changed-When: Tue Mar 4 22:56:53 PST 2003 
State-Changed-Why:  
Closed at submitter's request. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=48917 

From: Peter Pentchev <roam@ringlet.net>
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/48917: creating stf 6to4 IPv6 pseudo-interface adds wrong routes
Date: Wed, 5 Mar 2003 08:56:38 +0200

 Adding to the audit trail...
 
 G'luck,
 Peter
 
 -- 
 Peter Pentchev	roam@ringlet.net    roam@sbnd.net    roam@FreeBSD.org
 PGP key:	http://people.FreeBSD.org/~roam/roam.key.asc
 Key fingerprint	FDBA FD79 C26F 3C51 C95E  DF9E ED18 B68D 1619 4553
 I am jealous of the first word in this sentence.
 
 ----- Forwarded message from Pekka Savola <pekkas@netcore.fi> -----
 
 Date: Wed, 5 Mar 2003 06:14:44 +0200 (EET)
 From: Pekka Savola <pekkas@netcore.fi>
 To: David Malone <dwmalone@FreeBSD.org>
 Cc: freebsd-bugs@FreeBSD.org
 Subject: Re: kern/48917: creating stf 6to4 IPv6 pseudo-interface adds wrong
  routes
 
 On Tue, 4 Mar 2003, David Malone wrote:
 > Synopsis: creating stf 6to4 IPv6 pseudo-interface adds wrong routes
 > 
 > State-Changed-From-To: open->feedback
 > State-Changed-By: dwmalone
 > State-Changed-When: Tue Mar 4 13:45:10 PST 2003
 > State-Changed-Why: 
 > Hi Pekka,
 > 
 > Looking at your config, I see you have:
 > 
 > 	ipv6_ifconfig_rl0="2002:d436:1c91::1 prefixlen 64" # local network
 > 
 > but this address will be assigned to the stf0 interface when it is
 > configured. I presume rl0 is being reconfigured after this and the
 > IP is being moved (with all its routes) to rl0?
 > 
 > I think you can give another address to the stf interface by setting:
 > 
 > 	stf_interface_ipv6_slaid
 > 
 > Can you see if this seems to explain what you're seeing?
 
 Yes, definitely.  The problem was that I had made a typo with the config, 
 this:
 
 ipv6_ifconfig_rl0="2002:d436:1c91::1 prefixlen 64"
 
 should have been:
 
 ipv6_ifconfig_rl0="2002:d436:1c91:1::1 prefixlen 64"
 
 , which indeed fixed the problem.
 
 Sorry for the bogus report, the case can be closed :-(!
 
 
 To Unsubscribe: send mail to majordomo@FreeBSD.org
 with "unsubscribe freebsd-bugs" in the body of the message
 
 
 ----- End forwarded message -----
>Unformatted:
