From owner-freebsd-audit Mon Jun 25 12:27:24 2001 Delivered-To: freebsd-audit@freebsd.org Received: from prism.flugsvamp.com (cb58709-a.mdsn1.wi.home.com [24.17.241.9]) by hub.freebsd.org (Postfix) with ESMTP id 11B9B37B406; Mon, 25 Jun 2001 12:27:18 -0700 (PDT) (envelope-from jlemon@flugsvamp.com) Received: (from jlemon@localhost) by prism.flugsvamp.com (8.11.0/8.11.0) id f5PJPgs08421; Mon, 25 Jun 2001 14:25:42 -0500 (CDT) (envelope-from jlemon) Date: Mon, 25 Jun 2001 14:25:42 -0500 From: Jonathan Lemon To: Yar Tikhiy Cc: audit@FreeBSD.ORG, net@FreeBSD.ORG Subject: Re: Long ether frames & MTU Message-ID: <20010625142542.Z33375@prism.flugsvamp.com> References: <20010625230255.A11496@comp.chem.msu.su> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0pre2i In-Reply-To: <20010625230255.A11496@comp.chem.msu.su> Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Mon, Jun 25, 2001 at 11:02:55PM +0400, Yar Tikhiy wrote: > Hi there, > > While more and more Ethernet NIC drivers start supporting long > frames (>1518 bytes), the user/admin still cannot raise MTU on an > Ethernet interface above the 1500 byte limit due to outdated code > in net/if_ethersubr.c > > Please review the following patch that removes the limitation, and > also substitutes predefined symbolic names for some numeric constants. > > -- > Yar > > --- if_ethersubr.c Wed Mar 14 01:00:32 2001 > +++ /home/yar/if_ethersubr.c Mon Jun 25 22:45:25 2001 > @@ -677,8 +677,8 @@ > > if_attach(ifp); > ifp->if_type = IFT_ETHER; > - ifp->if_addrlen = 6; > - ifp->if_hdrlen = 14; > + ifp->if_addrlen = ETHER_ADDR_LEN; > + ifp->if_hdrlen = ETHER_HDR_LEN; > ifp->if_mtu = ETHERMTU; > ifp->if_resolvemulti = ether_resolvemulti; > if (ifp->if_baudrate == 0) > @@ -805,7 +805,7 @@ > /* > * Set the interface MTU. > */ > - if (ifr->ifr_mtu > ETHERMTU) { > + if (ifr->ifr_mtu > ETHERMTU + ifp->if_hdrlen - ETHER_HDR_LEN) { I'm not at all sure how this change will help anything, unless each driver alters if_hdrlen. My inclination would be to just leave the code alone, at the standard 1500 MTU. Drivers which actually are able to handle a larger mtu (e.g: 9000 byte Jumbograms) already have to do their own checks, and thus don't call this function. See, for example, any of the gigabit drivers. -- Jonathan To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message