lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Sun, 15 Jan 2017 00:55:02 +0200
From:   Rami Rosen <roszenrami@...il.com>
To:     Florian Fainelli <f.fainelli@...il.com>
Cc:     Alexander Loktionov <Alexander.Loktionov@...antia.com>,
        Netdev <netdev@...r.kernel.org>,
        David VomLehn <vomlehn@...as.net>,
        "David S . Miller" <davem@...emloft.net>,
        Simon Edelhaus <Simon.Edelhaus@...antia.com>,
        Dmitrii Tarakanov <Dmitrii.Tarakanov@...antia.com>,
        Pavel Belous <Pavel.Belous@...antia.com>,
        Dmitry Bezrukov <Dmitry.Bezrukov@...antia.com>
Subject: Re: [PATCH v5 05/13] net: ethernet: aquantia: Support for
 NIC-specific code

Hi, Florian,

> +}
> +
> +static int aq_ndev_change_mtu(struct net_device *ndev, int new_mtu)
> +{
> +     struct aq_nic_s *aq_nic = (struct aq_nic_s *)netdev_priv(ndev);
> +     int err = 0;
> +
> +     if (new_mtu == ndev->mtu) {
> +             err = 0;
> +             goto err_exit;
> +     }
> +     if (new_mtu < 68) {
> +             err = -EINVAL;
> +             goto err_exit;
> +     }

> What's so special about 68 here?

I think that the check that the passed MTU is at least 68 bytes is
justified and correct.
This convention is followed by a large number of Ethernet drivers; for example,
http://lxr.free-electrons.com/source/drivers/net/ethernet/intel/i40e/i40e_main.c#L2246
http://lxr.free-electrons.com/source/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c#L6049

The size of 68 bytes is originated from RFC 791:
https://tools.ietf.org/html/rfc791
...
Every internet module must be able to forward a datagram of 68 octets
without further fragmentation.
This is because an internet header may be up to 60 octets, and the
minimum fragment is 8 octets.
...

Regards,
Rami Rosen

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ