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 [EMAIL PROTECTED]
with "unsubscribe freebsd-net" in the body of the message