mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* change_mtu boundary checking error
@ 2001-04-17 12:29 Hen, Shmulik
  2001-04-17 12:40 ` Alan Cox
  0 siblings, 1 reply; 4+ messages in thread
From: Hen, Shmulik @ 2001-04-17 12:29 UTC (permalink / raw)
  To: 'LNML', 'LKML'

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)



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: change_mtu boundary checking error
  2001-04-17 12:29 change_mtu boundary checking error Hen, Shmulik
@ 2001-04-17 12:40 ` Alan Cox
  0 siblings, 0 replies; 4+ messages in thread
From: Alan Cox @ 2001-04-17 12:40 UTC (permalink / raw)
  To: Hen, Shmulik; +Cc: 'LNML', 'LKML'

> 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.

The IPv4 minimum MTU is 68 bytes. Below that not all frames can be delivered


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: change_mtu boundary checking error
  2001-04-18  7:25 Hen, Shmulik
@ 2001-04-18 12:22 ` Alan Cox
  0 siblings, 0 replies; 4+ messages in thread
From: Alan Cox @ 2001-04-18 12:22 UTC (permalink / raw)
  To: Hen, Shmulik; +Cc: linux-net, linux-kernel, 'Alan Cox'

> But Ethernet is not only for IP, what about other protocols ?

For 2.4 the checks were moved into the protocol layers. Any remaining check
in the driver layer for 68 would be a bug. For 2.2 its not going to change

^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: change_mtu boundary checking error
@ 2001-04-18  7:25 Hen, Shmulik
  2001-04-18 12:22 ` Alan Cox
  0 siblings, 1 reply; 4+ messages in thread
From: Hen, Shmulik @ 2001-04-18  7:25 UTC (permalink / raw)
  To: linux-net, linux-kernel; +Cc: 'Alan Cox'

But Ethernet is not only for IP, what about other protocols ?

-----Original Message-----
From: Alan Cox [mailto:alan@lxorguk.ukuu.org.uk]
Sent: Tuesday, April 17, 2001 3:41 PM
To: shmulik.hen@intel.com
Cc: linux-net@vger.kernel.org; linux-kernel@vger.kernel.org
Subject: Re: change_mtu boundary checking error


> 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.

The IPv4 minimum MTU is 68 bytes. Below that not all frames can be delivered



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2001-04-18 12:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-04-17 12:29 change_mtu boundary checking error Hen, Shmulik
2001-04-17 12:40 ` Alan Cox
2001-04-18  7:25 Hen, Shmulik
2001-04-18 12:22 ` Alan Cox

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®