Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e94cd811 authored by Zhang Shengju's avatar Zhang Shengju Committed by David S. Miller
Browse files

net: remove MTU limits for dummy and ifb device



These two drivers (dummy and ifb) call ether_setup(), after commit
61e84623 ("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: default avatarZhang Shengju <zhangshengju@cmss.chinamobile.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 1b17ca04
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -353,7 +353,7 @@ static void dummy_setup(struct net_device *dev)
	eth_hw_addr_random(dev);
	eth_hw_addr_random(dev);


	dev->min_mtu = 0;
	dev->min_mtu = 0;
	dev->max_mtu = ETH_MAX_MTU;
	dev->max_mtu = 0;
}
}


static int dummy_validate(struct nlattr *tb[], struct nlattr *data[],
static int dummy_validate(struct nlattr *tb[], struct nlattr *data[],
+3 −0
Original line number Original line Diff line number Diff line
@@ -231,6 +231,9 @@ static void ifb_setup(struct net_device *dev)
	eth_hw_addr_random(dev);
	eth_hw_addr_random(dev);
	dev->needs_free_netdev = true;
	dev->needs_free_netdev = true;
	dev->priv_destructor = ifb_dev_free;
	dev->priv_destructor = ifb_dev_free;

	dev->min_mtu = 0;
	dev->max_mtu = 0;
}
}


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