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. 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) 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.
I have checked about original KAME's code. And stf_output() in if_stf.c are like this. if (IN6_IS_ADDR_6TO4(&ip6->ip6_dst)) { ptr = GET_V4(sc, &ip6->ip6_dst); } if (IN6_IS_ADDR_6TO4(&dst6->sin6_addr)) { ptr = GET_V4(sc, &dst6->sin6_addr); } This codes are not changed before three years. And freebsd's is if (IN6_IS_ADDR_6TO4(&ip6->ip6_dst)) ptr = GET_V4(&ip6->ip6_dst); else if (IN6_IS_ADDR_6TO4(&dst6->sin6_addr)) ptr = GET_V4(&dst6->sin6_addr); else { Unnecessary "else" seems to be included, I think this difference is mistake at back-porting from KAME. Is it correct ?
I had created a new fixes based on KAME. And this fixes seems to be perfect. Please commit.
Responsible Changed From-To: freebsd-bugs->freebsd-net Actually this primarily affects sys/net/if_stf.c, with the conf files merely being an adjunct. Thus, reclassify and assign it, as submitter requested.
For bugs matching the following criteria: Status: In Progress Changed: (is less than) 2014-06-01 Reset to default assignee and clear in-progress tags. Mail being skipped