From: "Hen, Shmulik" <shmulik.hen@intel.com>
To: "'LNML'" <linux-net@vger.kernel.org>,
"'LKML'" <linux-kernel@vger.kernel.org>
Subject: change_mtu boundary checking error
Date: Tue, 17 Apr 2001 05:29:05 -0700 [thread overview]
Message-ID: <07E6E3B8C072D211AC4100A0C9C5758302B271DB@hasmsx52.iil.intel.com> (raw)
Hello,
Going through the change_mtu() code in the kernel, I came across the default
function supplied when calling ether_setup().
I could see that eth_change_mtu() (drivers/net/net_init.c) does the
following:
if( (new_mtu < 68) || (new_mtu > 1500) )
return -EINVAL;
Looking in include/linux/if_ether.h I found the following constants:
#define ETH_ALEN 6 /* Octets in one ethernet addr */
#define ETH_HLAN 14 /* Total octets in header. */
#define ETH_ZLEN 60 /* Min. octets in frame sans FCS */
#define ETH_DATA_LEN 1500 /* Max. octets in payload */
#define ETH_FRAME_LEN 1514 /* Max. octets in frame sans FCS */
Now, the high boundary seemed reasonable (ETH_FRAME_LEN - ETH_HLEN =
ETH_DATA_LEN) which gives 1500, but why is the low boundary set to 68 ?
According to my calculations, it should have been ETH_ZLEN - ETH_HLEN which
gives 46.
Doesn't mtu means only the payload size ?
Where did the 68 come from ?
Thanks,
Shmulik Hen
Software Engineer
Linux Advanced Networking Services
Network Communications Group, Israel (NCGj)
next reply other threads:[~2001-04-17 12:33 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-04-17 12:29 Hen, Shmulik [this message]
2001-04-17 12:40 ` Alan Cox
2001-04-18 7:25 Hen, Shmulik
2001-04-18 12:22 ` Alan Cox
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=07E6E3B8C072D211AC4100A0C9C5758302B271DB@hasmsx52.iil.intel.com \
--to=shmulik.hen@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-net@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®