change_mtu boundary checking error

From: Hen, Shmulik (shmulik.hen@intel.com)
Date: Tue Apr 17 2001 - 07:29:05 EST


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)

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Mon Apr 23 2001 - 21:00:22 EST