Skip to content

Commit

Permalink
net: remove MTU limits for dummy and ifb device
Browse files Browse the repository at this point in the history
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 <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>
  • Loading branch information
Zhang Shengju authored and David S. Miller committed Sep 25, 2017
1 parent 1b17ca0 commit e94cd81
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/dummy.c
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ static void dummy_setup(struct net_device *dev)
eth_hw_addr_random(dev);

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

static int dummy_validate(struct nlattr *tb[], struct nlattr *data[],
Expand Down
3 changes: 3 additions & 0 deletions drivers/net/ifb.c
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,9 @@ static void ifb_setup(struct net_device *dev)
eth_hw_addr_random(dev);
dev->needs_free_netdev = true;
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)
Expand Down

0 comments on commit e94cd81

Please sign in to comment.