Date: Mon, 25 Jun 2001 23:02:55 +0400 From: Yar Tikhiy <yar@freebsd.org> To: audit@freebsd.org, net@freebsd.org Subject: Long ether frames & MTU Message-ID: <20010625230255.A11496@comp.chem.msu.su>
next in thread | raw e-mail | index | archive | help
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) { error = EINVAL; } else { ifp->if_mtu = ifr->ifr_mtu; 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?20010625230255.A11496>