Skip to content

Commit e94cd81

Browse files
Zhang Shengjudavem330
Zhang Shengju
authored andcommitted
net: remove MTU limits for dummy and ifb device
These two drivers (dummy and ifb) call ether_setup(), after commit 61e8462 ("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 <[email protected]> CC: Sabrina Dubroca <[email protected]> Signed-off-by: Zhang Shengju <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 1b17ca0 commit e94cd81

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

drivers/net/dummy.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ static void dummy_setup(struct net_device *dev)
353353
eth_hw_addr_random(dev);
354354

355355
dev->min_mtu = 0;
356-
dev->max_mtu = ETH_MAX_MTU;
356+
dev->max_mtu = 0;
357357
}
358358

359359
static int dummy_validate(struct nlattr *tb[], struct nlattr *data[],

drivers/net/ifb.c

+3
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,9 @@ static void ifb_setup(struct net_device *dev)
231231
eth_hw_addr_random(dev);
232232
dev->needs_free_netdev = true;
233233
dev->priv_destructor = ifb_dev_free;
234+
235+
dev->min_mtu = 0;
236+
dev->max_mtu = 0;
234237
}
235238

236239
static netdev_tx_t ifb_xmit(struct sk_buff *skb, struct net_device *dev)

0 commit comments

Comments
 (0)