aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZhang Shengju <zhangshengju@cmss.chinamobile.com>2017-09-22 11:57:49 -0400
committerDavid S. Miller <davem@davemloft.net>2017-09-25 19:26:09 -0400
commite94cd8113ce63bca34040aae52d0603baf6ec07c (patch)
tree983dee3efd8758ef006e6d60fdc654d17d1bc7f8
parent1b17ca044a82342fb96529e1bdff6da7af90bc53 (diff)
net: remove MTU limits for dummy and ifb device
These two drivers (dummy and ifb) call ether_setup(), after commit 61e84623ace3 ("net: centralize net_device min/max MTU checking"), the range of mtu is [min_mtu, max_mtu], which is [68, 1500] by default. These two devices should not have limits on MTU. This patch set their min_mtu/max_mtu to 0. So that dev_set_mtu() will not check the mtu range, and can be set with any value. CC: Eric Dumazet <edumazet@google.com> CC: Sabrina Dubroca <sd@queasysnail.net> Signed-off-by: Zhang Shengju <zhangshengju@cmss.chinamobile.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/dummy.c2
-rw-r--r--drivers/net/ifb.c3
2 files changed, 4 insertions, 1 deletions
diff --git a/drivers/net/dummy.c b/drivers/net/dummy.c
index e31ab3b94c6f..58483af80bdb 100644
--- a/drivers/net/dummy.c
+++ b/drivers/net/dummy.c
@@ -353,7 +353,7 @@ static void dummy_setup(struct net_device *dev)
353 eth_hw_addr_random(dev); 353 eth_hw_addr_random(dev);
354 354
355 dev->min_mtu = 0; 355 dev->min_mtu = 0;
356 dev->max_mtu = ETH_MAX_MTU; 356 dev->max_mtu = 0;
357} 357}
358 358
359static int dummy_validate(struct nlattr *tb[], struct nlattr *data[], 359static int dummy_validate(struct nlattr *tb[], struct nlattr *data[],
diff --git a/drivers/net/ifb.c b/drivers/net/ifb.c
index 8870bd2a2e8a..0008da7e9d4c 100644
--- a/drivers/net/ifb.c
+++ b/drivers/net/ifb.c
@@ -231,6 +231,9 @@ static void ifb_setup(struct net_device *dev)
231 eth_hw_addr_random(dev); 231 eth_hw_addr_random(dev);
232 dev->needs_free_netdev = true; 232 dev->needs_free_netdev = true;
233 dev->priv_destructor = ifb_dev_free; 233 dev->priv_destructor = ifb_dev_free;
234
235 dev->min_mtu = 0;
236 dev->max_mtu = 0;
234} 237}
235 238
236static netdev_tx_t ifb_xmit(struct sk_buff *skb, struct net_device *dev) 239static netdev_tx_t ifb_xmit(struct sk_buff *skb, struct net_device *dev)