From owner-freebsd-bugs@FreeBSD.ORG Fri May 20 06:20:09 2011 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B078F106566B for ; Fri, 20 May 2011 06:20:09 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 835CB8FC15 for ; Fri, 20 May 2011 06:20:09 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id p4K6K9ET042751 for ; Fri, 20 May 2011 06:20:09 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id p4K6K9sE042750; Fri, 20 May 2011 06:20:09 GMT (envelope-from gnats) Resent-Date: Fri, 20 May 2011 06:20:09 GMT Resent-Message-Id: <201105200620.p4K6K9sE042750@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 797D61065670 for ; Fri, 20 May 2011 06:11:06 +0000 (UTC) (envelope-from kensaku.masuda@fujixerox.co.jp) Received: from futunusi.skyfx.rdh.fujixerox.co.jp (unknown [IPv6:2002:caf9:e86::1]) by mx1.freebsd.org (Postfix) with ESMTP id C22DB8FC1B for ; Fri, 20 May 2011 06:11:05 +0000 (UTC) Received: from futunusi.skyfx.rdh.fujixerox.co.jp (localhost [127.0.0.1]) by futunusi.skyfx.rdh.fujixerox.co.jp (8.14.4/8.14.4) with ESMTP id p4K66wi9003037 for ; Fri, 20 May 2011 15:06:58 +0900 (JST) (envelope-from kensaku.masuda@fujixerox.co.jp) Received: (from greg@localhost) by futunusi.skyfx.rdh.fujixerox.co.jp (8.14.4/8.14.4/Submit) id p4K66w2Z003036; Fri, 20 May 2011 15:06:58 +0900 (JST) (envelope-from greg) Message-Id: <201105200606.p4K66w2Z003036@futunusi.skyfx.rdh.fujixerox.co.jp> Date: Fri, 20 May 2011 15:06:58 +0900 (JST) From: To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: Subject: kern/157200: stf(4) can not communication between other 6to4 preix holder X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: kensaku.masuda@gmail.com List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2011 06:20:09 -0000 >Number: 157200 >Category: kern >Synopsis: stf(4) can not communication between other 6to4 preix holder >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Fri May 20 06:20:09 UTC 2011 >Closed-Date: >Last-Modified: >Originator: Kensaku MASUDA >Release: FreeBSD 8.2-STABLE amd64 >Organization: >Environment: System: FreeBSD futunusi.skyfx.rdh.fujixerox.co.jp 8.2-STABLE FreeBSD 8.2-STABLE #3: Thu May 19 12:57:19 JST 2011 root@futunusi.skyfx.rdh.fujixerox.co.jp:/usr/src/sys/amd64/compile/futunusi.skyfx.rdh.fujixerox.co.jp amd64 >Description: stf(4) is work fine between native prefixes. But other 6to4 prefix holder is not. Case of with navtive prefix, stf send a packet(protocol 41) into anycast router. But other 6to4 prefix, stf send a packet into its V4 address directly. and other side router drop it. >How-To-Repeat: 1) Setup stf: stf_interface_ipv4addr="XXX.XXX.XXX.XXX" <- Global V4 Address ipv6_defaultrouter="2002:c058:6301::1" <- 192.88.99.1 6to4 anycast router 2) ping to native v6 machine(Ex: www.kame.net) 3) see protocol 41 packet, you see a packet that destination is 192.88.99.1. 4) ping to some 6to4 prefix holder(2002::YYYY:YYYY:?????.....) 5) see protocol 41 packet, you see a packet that destination is YY.YY.YY.YY. >Fix: function stf_output(mbuf, dest, ro) in if_stf.c create a outgoing packet for stf(4). And stf_output address IPv4 address from mbuf(outgoing IPv6 packet) or dest. I think that it use only "dest", no need to refer raw IPv6 packet. because, "dest" was look like computed from routing table and interface prefix length. And problem will clear,so delete routing information about 2002::/16 or above. (Need to setup route using anycast router) diff -ruN src.orig/etc/defaults/rc.conf src/etc/defaults/rc.conf --- src.orig/etc/defaults/rc.conf 2011-05-20 14:19:34.341476080 +0900 +++ src/etc/defaults/rc.conf 2011-05-20 14:18:23.927534426 +0900 @@ -494,6 +494,7 @@ stf_interface_ipv6_ifid="0:0:0:1" # IPv6 interface id for stf0. # If you like, you can set "AUTO" for this. stf_interface_ipv6_slaid="0000" # IPv6 Site Level Aggregator for stf0 +stf_interface_mode="anycast" # Anycast router or edge router ipv6_faith_prefix="NO" # Set faith prefix to enable a FAITH # IPv6-to-IPv4 TCP translator. You also need # faithd(8) setup. diff -ruN src.orig/etc/network.subr src/etc/network.subr --- src.orig/etc/network.subr 2011-05-20 14:19:50.528201421 +0900 +++ src/etc/network.subr 2011-05-20 14:17:59.467935221 +0900 @@ -1042,6 +1042,14 @@ route add -inet6 2002:7f00:: -prefixlen 24 ::1 -reject route add -inet6 2002:0000:: -prefixlen 24 ::1 -reject route add -inet6 2002:ff00:: -prefixlen 24 ::1 -reject + case ${stf_interface_mode} in + [Aa][Nn][Yy][Cc][Aa][Ss][Tt]) + ;; + [Ee][Dd][Gg][Ee]) + route -q del -inet6 2002:${ipv4_in_hexformat}::/${stf_prefixlen} + route -q del -inet6 2002::/${stf_prefixlen} + ;; + esac ;; esac } diff -ruN src.orig/sys/net/if_stf.c src/sys/net/if_stf.c --- src.orig/sys/net/if_stf.c 2011-05-20 14:20:08.610057217 +0900 +++ src/sys/net/if_stf.c 2011-05-20 14:19:12.535445653 +0900 @@ -479,11 +479,18 @@ /* * Pickup the right outer dst addr from the list of candidates. * ip6_dst has priority as it may be able to give us shorter IPv4 hops. + * + * NOTICE: dst is computed by routing tables and network prefix. + * In broadcast segment, ip6->ip6_dst and dst6->sin6_addr are same. + * Othersise, dst is found from routeing table. */ ptr = NULL; +/* if (IN6_IS_ADDR_6TO4(&ip6->ip6_dst)) ptr = GET_V4(&ip6->ip6_dst); - else if (IN6_IS_ADDR_6TO4(&dst6->sin6_addr)) + else +*/ + if (IN6_IS_ADDR_6TO4(&dst6->sin6_addr)) ptr = GET_V4(&dst6->sin6_addr); else { ifa_free(&ia6->ia_ifa); >Release-Note: >Audit-Trail: >Unformatted: