From owner-freebsd-net Mon Jun 25 12: 3:13 2001 Delivered-To: freebsd-net@freebsd.org Received: from mail.chem.msu.ru (mail.chem.msu.ru [195.208.208.19]) by hub.freebsd.org (Postfix) with ESMTP id 49D7E37B40B; Mon, 25 Jun 2001 12:03:02 -0700 (PDT) (envelope-from yar@comp.chem.msu.su) Received: from comp.chem.msu.su ([158.250.32.97]) by mail.chem.msu.ru with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2650.21) id NHPRVFB2; Mon, 25 Jun 2001 22:58:21 +0400 Received: (from yar@localhost) by comp.chem.msu.su (8.11.1/8.11.1) id f5PJ2ux13205; Mon, 25 Jun 2001 23:02:56 +0400 (MSD) (envelope-from yar) Date: Mon, 25 Jun 2001 23:02:55 +0400 From: Yar Tikhiy To: audit@freebsd.org, net@freebsd.org Subject: Long ether frames & MTU Message-ID: <20010625230255.A11496@comp.chem.msu.su> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org 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-net" in the body of the message