Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: point2point network interfaces cannot receive ipv6 packets



I can confirm that this patch works on my tun device (carrying ipv6 inside ipv4).


On Sun, 12 Apr 2015, Roy Marples wrote:

On Fri, 2015-04-10 at 17:27 +0100, Robert Swindells wrote:
Kengo NAKAHARA <k-nakahara%iij.ad.jp@localhost> 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 {


We shouldn't really need the LLINFO flag on P2P interfaces.
Here is a patch which introduces p2p_rtrequest() which installs a
correct and working local route for P2P interfaces, based on an older
patch for OpenBSD.

I intend to commit this to fix the PR early next week when I can put
more testing into it. Commentary welcome as I can't test many P2P
interfaces.

Roy


-------------------------------------------------------------------------
| Paul Goyette     | PGP Key fingerprint:     | E-mail addresses:       |
| (Retired)        | FA29 0E3B 35AF E8AE 6651 | paul at whooppee.com    |
| Network Engineer | 0786 F758 55DE 53BA 7731 | pgoyette at juniper.net |
| Kernel Developer |                          | pgoyette at netbsd.org  |
-------------------------------------------------------------------------


Home | Main Index | Thread Index | Old Index