igb: limit minimum mtu to 68 to keep ip bound to interface
authorAlexander Duyck <alexander.h.duyck@intel.com>
Tue, 27 Oct 2009 23:52:13 +0000 (23:52 +0000)
committerDavid S. Miller <davem@davemloft.net>
Wed, 28 Oct 2009 10:26:06 +0000 (03:26 -0700)
Limit the minimum mtu to 68 in order to prevent ip from being unbound from
the interface.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/igb/igb_main.c

index 264ff005710b3a0303fe11d483b0628423ea9ada..846e64f0ad86147de373fc9baca2f6548ff83dad 100644 (file)
@@ -3709,8 +3709,7 @@ static int igb_change_mtu(struct net_device *netdev, int new_mtu)
        int max_frame = new_mtu + ETH_HLEN + ETH_FCS_LEN;
        u32 rx_buffer_len, i;
 
-       if ((max_frame < ETH_ZLEN + ETH_FCS_LEN) ||
-           (max_frame > MAX_JUMBO_FRAME_SIZE)) {
+       if ((new_mtu < 68) || (max_frame > MAX_JUMBO_FRAME_SIZE)) {
                dev_err(&pdev->dev, "Invalid MTU setting\n");
                return -EINVAL;
        }