aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Brandeburg <jesse.brandeburg@intel.com>2008-07-08 18:51:32 -0400
committerJeff Garzik <jgarzik@redhat.com>2008-07-11 01:20:27 -0400
commita65a604a01f710defe01f2322e108f4d8c20f6ce (patch)
treece952508ead861ef623ed88b5a98ac90fc2ac5cd
parent72ab51954d108e4999b3c958ae21da731d2d789a (diff)
ixgb: don't allow too small MTU
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>
-rw-r--r--drivers/net/ixgb/ixgb_main.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/net/ixgb/ixgb_main.c b/drivers/net/ixgb/ixgb_main.c
index 60cad65dbc2e..0e72dadf8b70 100644
--- a/drivers/net/ixgb/ixgb_main.c
+++ b/drivers/net/ixgb/ixgb_main.c
@@ -1566,9 +1566,9 @@ ixgb_change_mtu(struct net_device *netdev, int new_mtu)
1566 int max_frame = new_mtu + ENET_HEADER_SIZE + ENET_FCS_LENGTH; 1566 int max_frame = new_mtu + ENET_HEADER_SIZE + ENET_FCS_LENGTH;
1567 int old_max_frame = netdev->mtu + ENET_HEADER_SIZE + ENET_FCS_LENGTH; 1567 int old_max_frame = netdev->mtu + ENET_HEADER_SIZE + ENET_FCS_LENGTH;
1568 1568
1569 1569 /* MTU < 68 is an error for IPv4 traffic, just don't allow it */
1570 if((max_frame < IXGB_MIN_ENET_FRAME_SIZE_WITHOUT_FCS + ENET_FCS_LENGTH) 1570 if ((new_mtu < 68) ||
1571 || (max_frame > IXGB_MAX_JUMBO_FRAME_SIZE + ENET_FCS_LENGTH)) { 1571 (max_frame > IXGB_MAX_JUMBO_FRAME_SIZE + ENET_FCS_LENGTH)) {
1572 DPRINTK(PROBE, ERR, "Invalid MTU setting %d\n", new_mtu); 1572 DPRINTK(PROBE, ERR, "Invalid MTU setting %d\n", new_mtu);
1573 return -EINVAL; 1573 return -EINVAL;
1574 } 1574 }