Hi Sorry for the late response, been busy on the Spanish beaches!
On Fri, 2015-04-10 at 17:27 +0100, Robert Swindells wrote: > Kengo NAKAHARA <[email protected]> wrote: > >On 2015/04/03 16:14, Takahiro HAYASHI wrote: > >> It seems that IFF_POINTTOPOINT interfaces like tun and gif cannot > >> receive ipv6 packets. > >> This occurs on NetBSD/amd64 -current since Feb 27 2015. > >> > >> For example, establishing gif tunnnel between 2 hosts. > >> > >> [host1] <---> [host2] > >> 192.168.0.1 192.168.0.2 ipv4 address of real interface > >> fd00::1 fd00::2 gif address > >> > >> When I ping6, a host can send ICMPv6 ECHO(128), but the other host > >> returns ICMPv6 DST_UNREACH(1) code UNREACH_ADDR(3) to pinging host. > > > >I think the reason of this issue is below commit: > > > > http://www.nerv.org/netbsd/?q=id:20150226T095446Z.75354d997222ae09acc944ba1c6cf573c3ea724b > > The following patch helps for me. It results in the RTF_LLINFO flag getting > set for the route for the interface. > > The comment looks to be incorrect in any case. > > Robert Swindells > > Index: in6.c > =================================================================== > RCS file: /cvsroot/src/sys/netinet6/in6.c,v > retrieving revision 1.186 > diff -u -r1.186 in6.c > --- in6.c 7 Apr 2015 23:30:36 -0000 1.186 > +++ in6.c 10 Apr 2015 16:10:31 -0000 > @@ -1695,7 +1695,7 @@ > /* Add ownaddr as loopback rtentry, if necessary (ex. on p2p link). */ > if (newhost) { > /* set the rtrequest function to create llinfo */ > - if ((ifp->if_flags & (IFF_LOOPBACK | IFF_POINTOPOINT)) == 0) > + if ((ifp->if_flags & IFF_LOOPBACK) == 0) > ia->ia_ifa.ifa_rtrequest = nd6_rtrequest; > in6_ifaddlocal(&ia->ia_ifa); > } else { > This fixes the problem where you can now ping the fd00::2 address on gif2, but it still lacks the same gateway as in the original netstat output. A similar patch to sys/net/route.c is needed. Index: net/route.c =================================================================== RCS file: /cvsroot/src/sys/net/route.c,v retrieving revision 1.142 diff -u -r1.142 route.c --- net/route.c 7 Apr 2015 04:36:19 -0000 1.142 +++ net/route.c 10 Apr 2015 21:23:09 -0000 @@ -1040,7 +1040,7 @@ } flags = RTF_UP | RTF_HOST | RTF_LOCAL; - if (!(ifa->ifa_ifp->if_flags & (IFF_LOOPBACK | IFF_POINTOPOINT))) + if (!(ifa->ifa_ifp->if_flags & IFF_LOOPBACK)) flags |= RTF_LLINFO; e = rtrequest(cmd, ifa->ifa_addr, ifa->ifa_addr, all1_sa, flags, &nrt); However, I cannot seem to fix the IPv4 case described in the PR. More investigation needed there. Roy
