ixgb: don't allow too small MTU
authorJesse Brandeburg <jesse.brandeburg@intel.com>
Tue, 8 Jul 2008 22:51:32 +0000 (15:51 -0700)
committerJeff Garzik <jgarzik@redhat.com>
Fri, 11 Jul 2008 05:20:27 +0000 (01:20 -0400)
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
drivers/net/ixgb/ixgb_main.c

index 60cad65dbc2e859ffd6be91aaa152cbfb805fcef..0e72dadf8b70b94004a2db512a0ffe13403e7c7a 100644 (file)
@@ -1566,9 +1566,9 @@ ixgb_change_mtu(struct net_device *netdev, int new_mtu)
        int max_frame = new_mtu + ENET_HEADER_SIZE + ENET_FCS_LENGTH;
        int old_max_frame = netdev->mtu + ENET_HEADER_SIZE + ENET_FCS_LENGTH;
 
-
-       if((max_frame < IXGB_MIN_ENET_FRAME_SIZE_WITHOUT_FCS + ENET_FCS_LENGTH)
-          || (max_frame > IXGB_MAX_JUMBO_FRAME_SIZE + ENET_FCS_LENGTH)) {
+       /* MTU < 68 is an error for IPv4 traffic, just don't allow it */
+       if ((new_mtu < 68) ||
+           (max_frame > IXGB_MAX_JUMBO_FRAME_SIZE + ENET_FCS_LENGTH)) {
                DPRINTK(PROBE, ERR, "Invalid MTU setting %d\n", new_mtu);
                return -EINVAL;
        }