Date: Mon, 25 Jun 2001 14:25:42 -0500 From: Jonathan Lemon <jlemon@flugsvamp.com> To: Yar Tikhiy <yar@FreeBSD.ORG> Cc: audit@FreeBSD.ORG, net@FreeBSD.ORG Subject: Re: Long ether frames & MTU Message-ID: <20010625142542.Z33375@prism.flugsvamp.com> In-Reply-To: <20010625230255.A11496@comp.chem.msu.su> References: <20010625230255.A11496@comp.chem.msu.su>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010625142542.Z33375>
