aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/igb/igb_main.c
diff options
context:
space:
mode:
authorAlexander Duyck <alexander.h.duyck@intel.com>2009-10-27 19:52:13 -0400
committerDavid S. Miller <davem@davemloft.net>2009-10-28 06:26:06 -0400
commitc809d2276cb035228cd9e83e2ca7d2b902c61cef (patch)
treec0fc93c5179142f6950a87ed3adea90911146eb4 /drivers/net/igb/igb_main.c
parent090b17952826eb3c5d712b6d4f90a292fe4acc93 (diff)
igb: limit minimum mtu to 68 to keep ip bound to interface
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>
Diffstat (limited to 'drivers/net/igb/igb_main.c')
-rw-r--r--drivers/net/igb/igb_main.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
index 264ff005710b..846e64f0ad86 100644
--- a/drivers/net/igb/igb_main.c
+++ b/drivers/net/igb/igb_main.c
@@ -3709,8 +3709,7 @@ static int igb_change_mtu(struct net_device *netdev, int new_mtu)
3709 int max_frame = new_mtu + ETH_HLEN + ETH_FCS_LEN; 3709 int max_frame = new_mtu + ETH_HLEN + ETH_FCS_LEN;
3710 u32 rx_buffer_len, i; 3710 u32 rx_buffer_len, i;
3711 3711
3712 if ((max_frame < ETH_ZLEN + ETH_FCS_LEN) || 3712 if ((new_mtu < 68) || (max_frame > MAX_JUMBO_FRAME_SIZE)) {
3713 (max_frame > MAX_JUMBO_FRAME_SIZE)) {
3714 dev_err(&pdev->dev, "Invalid MTU setting\n"); 3713 dev_err(&pdev->dev, "Invalid MTU setting\n");
3715 return -EINVAL; 3714 return -EINVAL;
3716 } 3715 }