NetBSD Problem Report #39203

From stix@stix.id.au  Fri Jul 25 04:25:03 2008
Return-Path: <stix@stix.id.au>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by narn.NetBSD.org (Postfix) with ESMTP id F303B63B880
	for <gnats-bugs@gnats.NetBSD.org>; Fri, 25 Jul 2008 04:25:02 +0000 (UTC)
Message-Id: <20080725042459.0072C67FBA@stix.id.au>
Date: Fri, 25 Jul 2008 14:24:58 +1000 (EST)
From: stix@stix.id.au
Reply-To: stix@stix.id.au
To: gnats-bugs@gnats.NetBSD.org
Cc: Martin Husemann <martin@duskware.de>
Subject: PPPoE issues with broken MTU/MRU implementations
X-Send-Pr-Version: 3.95

>Number:         39203
>Category:       kern
>Synopsis:       PPPoE issues with broken MTU/MRU implementations
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    kern-bug-people
>State:          closed
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Fri Jul 25 04:30:00 +0000 2008
>Closed-Date:    Sat Apr 04 21:59:59 +0000 2009
>Last-Modified:  Sat Apr 04 21:59:59 +0000 2009
>Originator:     Paul Ripke
>Release:        All
>Organization:
>Environment:
System: NetBSD zion.stix.org.au 4.0_STABLE NetBSD 4.0_STABLE (ZION) #5: Wed May 7 21:32:47 EST 2008 stix@zion.stix.org.au:/export/netbsd/netbsd-4/obj.i386/export/netbsd/netbsd-4/src/sys/arch/i386/compile/ZION i386
Architecture: i386
Machine: i386
>Description:

It appears some ISPs ignore MRU negotiation during pppoe setup, and
use full 1500 byte MTU/MRU. This results in NetBSD dropping the
oversize/giant packets, assuming they even make it to the system. The
attached patch stops the NetBSD kernel from dropping these packets.

See also:
http://mail-index.netbsd.org/tech-net/2008/04/14/msg000406.html
http://mail-index.netbsd.org/tech-net/2003/08/15/0002.html
http://forum.exetel.com.au/viewtopic.php?t=26544

>How-To-Repeat:

Obtain account with broken ISP, then try large pings or VPN with large
UDP authentication certificates.
>Fix:

I have been running with the attached patch (or the netbsd-4 equivalent)
for a few months successfully. Of course, this will only work if the
frames make it to the NIC (some 10/100Mbit switches drop giants) and
the NIC will accept these large frames (gigabit NICs generally should).

Thanks to Quentin for the initial patch - I've made the attached non-
selectable, but that's easy enough to add back if required. Also, my
NIC (msk0) accepts the giants without modification.

Index: sys/net/if_ether.h
===================================================================
RCS file: /usr/netbsd/cvsroot/src/sys/net/if_ether.h,v
retrieving revision 1.51
diff -u -d -r1.51 if_ether.h
--- sys/net/if_ether.h	22 May 2008 01:15:33 -0000	1.51
+++ sys/net/if_ether.h	1 Jul 2008 05:01:03 -0000
@@ -56,6 +56,7 @@
  * Some Ethernet extensions.
  */
 #define	ETHER_VLAN_ENCAP_LEN 4	/* length of 802.1Q VLAN encapsulation */
+#define	ETHER_PPPOE_ENCAP_LEN 8	/* length of PPPoE encapsulation */

 /*
  * Ethernet address - 6 octets
@@ -90,7 +91,8 @@
 #define	ETHER_MAX_FRAME(ifp, etype, hasfcs)				\
 	((ifp)->if_mtu + ETHER_HDR_LEN +				\
 	 ((hasfcs) ? ETHER_CRC_LEN : 0) +				\
-	 (((etype) == ETHERTYPE_VLAN) ? ETHER_VLAN_ENCAP_LEN : 0))
+	 (((etype) == ETHERTYPE_VLAN) ? ETHER_VLAN_ENCAP_LEN : 0) +	\
+	 (((etype) == ETHERTYPE_PPPOE) ? ETHER_PPPOE_ENCAP_LEN : 0))

 /*
  * Ethernet CRC32 polynomials (big- and little-endian verions).

>Release-Note:

>Audit-Trail:
From: Christos Zoulas <christos@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/39203 CVS commit: src/sys/net
Date: Fri, 25 Jul 2008 15:10:25 +0000 (UTC)

 Module Name:	src
 Committed By:	christos
 Date:		Fri Jul 25 15:10:25 UTC 2008

 Modified Files:
 	src/sys/net: if_ether.h

 Log Message:
 PR/39203: Paul Ripke: PPPoE issues with broken MTU/MRU implementations
 Allow larger frames for systems that don't negotiate MTU/MRU properly.


 To generate a diff of this commit:
 cvs rdiff -r1.51 -r1.52 src/sys/net/if_ether.h

 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: dholland@NetBSD.org
State-Changed-When: Tue, 24 Mar 2009 22:16:08 +0000
State-Changed-Why:
Fixed? Or does this need to be pulled up to 4.0?


From: Paul Ripke <stix@stix.id.au>
To: gnats-bugs@NetBSD.org
Cc: kern-bug-people@netbsd.org, netbsd-bugs@netbsd.org,
	gnats-admin@netbsd.org, dholland@NetBSD.org
Subject: Re: kern/39203 (PPPoE issues with broken MTU/MRU implementations)
Date: Sat, 28 Mar 2009 18:42:03 +1100

 A pull up to 4.0 sounds good to me - although I'm personally not
 fussed either way.

 -- 
 Paul Ripke

From: David Holland <dholland-bugs@netbsd.org>
To: Paul Ripke <stix@stix.id.au>
Cc: gnats-bugs@NetBSD.org, kern-bug-people@netbsd.org,
	netbsd-bugs@netbsd.org, gnats-admin@netbsd.org, dholland@NetBSD.org
Subject: Re: kern/39203 (PPPoE issues with broken MTU/MRU implementations)
Date: Sat, 28 Mar 2009 18:29:16 +0000

 On Sat, Mar 28, 2009 at 06:42:03PM +1100, Paul Ripke wrote:
  > A pull up to 4.0 sounds good to me - although I'm personally not
  > fussed either way.

 It sounds like a good idea to me, but I can't test it... I take it you
 have?

 -- 
 David A. Holland
 dholland@netbsd.org

From: Paul Ripke <stix@stix.id.au>
To: David Holland <dholland-bugs@netbsd.org>
Cc: gnats-bugs@NetBSD.org, kern-bug-people@netbsd.org,
	netbsd-bugs@netbsd.org, gnats-admin@netbsd.org, dholland@NetBSD.org
Subject: Re: kern/39203 (PPPoE issues with broken MTU/MRU implementations)
Date: Sun, 29 Mar 2009 11:33:48 +1100

 On Sat, Mar 28, 2009 at 06:29:16PM +0000, David Holland wrote:
 > On Sat, Mar 28, 2009 at 06:42:03PM +1100, Paul Ripke wrote:
 >  > A pull up to 4.0 sounds good to me - although I'm personally not
 >  > fussed either way.
 > 
 > It sounds like a good idea to me, but I can't test it... I take it you
 > have?

 My main home gateway-firewall-server box is still running 4.0 release
 branch with this patch. Indeed, various things don't work without this
 patch.

 -- 
 Paul Ripke

State-Changed-From-To: feedback->pending-pullups
State-Changed-By: dholland@NetBSD.org
State-Changed-When: Sun, 29 Mar 2009 05:43:01 +0000
State-Changed-Why:
pullup-4 #1294


State-Changed-From-To: pending-pullups->closed
State-Changed-By: dholland@NetBSD.org
State-Changed-When: Sat, 04 Apr 2009 21:59:59 +0000
State-Changed-Why:
Pullup complete; thanks.


>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-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.