NetBSD Problem Report #49829

From t.hash425@gmail.com  Thu Apr  9 13:32:34 2015
Return-Path: <t.hash425@gmail.com>
Received: from mail.netbsd.org (mail.netbsd.org [149.20.53.66])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "mail.netbsd.org", Issuer "Postmaster NetBSD.org" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 71DDFA582D
	for <gnats-bugs@gnats.NetBSD.org>; Thu,  9 Apr 2015 13:32:34 +0000 (UTC)
Message-Id: <55267F53.8030207@gmail.com>
Date: Thu, 09 Apr 2015 22:32:03 +0900
From: Takahiro HAYASHI <t.hash425@gmail.com>
To: gnats-bugs@NetBSD.org
Subject: point2point network interfaces cannot receive packets

>Number:         49829
>Category:       kern
>Synopsis:       point2point network interfaces cannot receive packets
>Confidential:   no
>Severity:       critical
>Priority:       medium
>Responsible:    kern-bug-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Apr 09 13:35:00 +0000 2015
>Closed-Date:    Mon Apr 20 14:35:07 +0000 2015
>Last-Modified:  Mon Apr 20 14:35:07 +0000 2015
>Originator:     Takahiro HAYASHI
>Release:        NetBSD 7.99.9
>Organization:
>Environment:
System: NetBSD 7.99.9 amd64
Architecture: x86_64
Machine: amd64
>Description:
	IFF_POINTTOPOINT interfaces like tun and gif cannot
	receive 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.
	netstat -nr | grep gif0 is:

fd00::/64                               fd00::1                        UC            0      -  gif0
fd00::1                                 fd00::1                        UHl           5      -  gif0
fe80::%gif0/64                          fe80::216:3eff:fe00:f2         UC            0      -  gif0
fe80::216:3eff:fe00:f2                  fe80::216:3eff:fe00:f2         UHl           0      -  gif0
ff01:3::/32                             fd00::1                        UC            0      -  gif0
ff02::%gif0/32                          fd00::1                        UC            0      -  gif0

	OTOH this problem also happens in v4.
	(see v4 over v6 part of How-To-Repeat)
	"netstat -nr | grep gif0" shows:

192.168.0.1        192.168.0.1        UHl           2      -  gif0
fe80::%gif0/64                          fe80::216:3eff:fe00:f2         UC            0      -  gif0
fe80::216:3eff:fe00:f2                  fe80::216:3eff:fe00:f2         UHl           0      -  gif0
ff01:3::/32                             fe80::216:3eff:fe00:f2         UC            0      -  gif0
ff02::%gif0/32                          fe80::216:3eff:fe00:f2         UC            0      -  gif0

	routes that have RTF_LOCAL do not face to lo0.


>How-To-Repeat:
	In case of v6 over v4:
	ifconfig gif0 create
	ifconfig gif0 fd00::1
	ifconfig gif0 tunnel 192.168.0.1 192.168.0.2
	ping6 -n fd00::1

	In case of v4 over v6:
	ifconfig gif0 create
	ifconfig gif0 192.168.0.1
	ifconfig gif0 tunnel fd00::1 fd00::2
	ping -n 192.168.0.1

>Fix:
	No idea.


-- 
t-hash

>Release-Note:

>Audit-Trail:
From: Takahiro HAYASHI <t.hash425@gmail.com>
To: gnats-bugs@NetBSD.org, kern-bug-people@netbsd.org, 
 gnats-admin@netbsd.org, netbsd-bugs@netbsd.org
Cc: 
Subject: Re: kern/49829: point2point network interfaces cannot receive packets
Date: Fri, 10 Apr 2015 18:12:56 +0900

 pppoe(4) also affected, suggested by Robert Swindells.

 On -current kernel:

 # ifconfig pppoe0 create up
 # ifconfig pppoe0
 pppoe0: flags=8851<UP,POINTOPOINT,RUNNING,SIMPLEX,MULTICAST> mtu 1492
          inet6 fe80::216:3eff:fe00:f2%pppoe0 ->  prefixlen 64 scopeid 0x3
 # netstat -nr
 Routing tables

 Internet6:
 Destination                             Gateway                        Flags       Use    Mtu Interface
 fe80::%pppoe0/64                        fe80::216:3eff:fe00:f2         UC            0      -  pppoe0
 fe80::216:3eff:fe00:f2                  fe80::216:3eff:fe00:f2         UHl           0      -  pppoe0
 ff01:3::/32                             fe80::216:3eff:fe00:f2         UC            0      -  pppoe0
 ff02::%pppoe0/32                        fe80::216:3eff:fe00:f2         UC            0      -  pppoe0
 # ping6 -n fe80::216:3eff:fe00:f2%pppoe0
 PING6(56=40+8+8 bytes) fe80::216:3eff:fe00:f2%pppoe0 --> fe80::216:3eff:fe00:f2%pppoe0
 ^C
 --- fe80::216:3eff:fe00:f2%pppoe0 ping6 statistics ---
 3 packets transmitted, 0 packets received, 100.0% packet loss
 #


 On netbsd-7 kernel:

 # ifconfig pppoe0 create up
 # ifconfig pppoe0
 pppoe0: flags=8851<UP,POINTOPOINT,RUNNING,SIMPLEX,MULTICAST> mtu 1492
          inet6 fe80::216:3eff:fe00:f2%pppoe0 ->  prefixlen 64 scopeid 0x3
 # netstat -nr
 Routing tables

 Internet6:
 Destination                        Gateway                        Flags    Refs      Use    Mtu Interface
 fe80::%pppoe0/64                   link#3                         UC          -        0      -L pppoe0
 fe80::216:3eff:fe00:f2             link#3                         UHL         -        0      -L lo0
 ff01:3::/32                        link#3                         UC          -        0      -L pppoe0
 ff02::%pppoe0/32                   link#3                         UC          -        0      -L pppoe0
 # ping6 -n fe80::216:3eff:fe00:f2%pppoe0
 PING6(56=40+8+8 bytes) fe80::216:3eff:fe00:f2%pppoe0 --> fe80::216:3eff:fe00:f2%pppoe0
 16 bytes from fe80::216:3eff:fe00:f2%pppoe0, icmp_seq=0 hlim=64 time=10.642 ms
 16 bytes from fe80::216:3eff:fe00:f2%pppoe0, icmp_seq=1 hlim=64 time=0.059 ms
 16 bytes from fe80::216:3eff:fe00:f2%pppoe0, icmp_seq=2 hlim=64 time=0.045 ms
 ^C


 -- 
 t-hash

From: "Roy Marples" <roy@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/49829 CVS commit: src/sys
Date: Mon, 20 Apr 2015 10:19:55 +0000

 Module Name:	src
 Committed By:	roy
 Date:		Mon Apr 20 10:19:54 UTC 2015

 Modified Files:
 	src/sys/net: if.c if.h if_gif.c if_gre.c if_ppp.c if_spppsubr.c
 	    if_tun.c
 	src/sys/netinet6: in6.c

 Log Message:
 Introduce p2p_rtrequest() so that IFF_POINTOPOINT interfaces can work
 with RTF_LOCAL.
 Fixes PR kern/49829.


 To generate a diff of this commit:
 cvs rdiff -u -r1.309 -r1.310 src/sys/net/if.c
 cvs rdiff -u -r1.187 -r1.188 src/sys/net/if.h
 cvs rdiff -u -r1.83 -r1.84 src/sys/net/if_gif.c
 cvs rdiff -u -r1.162 -r1.163 src/sys/net/if_gre.c
 cvs rdiff -u -r1.146 -r1.147 src/sys/net/if_ppp.c
 cvs rdiff -u -r1.131 -r1.132 src/sys/net/if_spppsubr.c
 cvs rdiff -u -r1.120 -r1.121 src/sys/net/if_tun.c
 cvs rdiff -u -r1.186 -r1.187 src/sys/netinet6/in6.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: open->feedback
State-Changed-By: roy@NetBSD.org
State-Changed-When: Mon, 20 Apr 2015 10:23:39 +0000
State-Changed-Why:
Please confirm that the above changes fix the issue.


From: Takahiro HAYASHI <t.hash425@gmail.com>
To: gnats-bugs@NetBSD.org, kern-bug-people@netbsd.org, 
 netbsd-bugs@netbsd.org, gnats-admin@netbsd.org, roy@NetBSD.org
Cc: 
Subject: Re: kern/49829 (point2point network interfaces cannot receive packets)
Date: Mon, 20 Apr 2015 23:27:29 +0900

 On 2015/04/20 19:23, roy@NetBSD.org wrote:
 > Synopsis: point2point network interfaces cannot receive packets
 >
 > State-Changed-From-To: open->feedback
 > State-Changed-By: roy@NetBSD.org
 > State-Changed-When: Mon, 20 Apr 2015 10:23:39 +0000
 > State-Changed-Why:
 > Please confirm that the above changes fix the issue.

 I've confirmed the problem is now fixed on gif and pppoe
 by ping'ing to v4 and v6 address of itself and checking
 the interface of RTF_LOCAL route is lo0.

 Thank you!


 -- 
 t-hash

State-Changed-From-To: feedback->closed
State-Changed-By: roy@NetBSD.org
State-Changed-When: Mon, 20 Apr 2015 14:35:07 +0000
State-Changed-Why:
Submitter reports fixed.


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2014 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.