Skip to content

Commit e1043a4

Browse files
Mohammed Gamalbostrovs
authored andcommitted
xen-netfront, xen-netback: Use correct minimum MTU values
RFC791 specifies the minimum MTU to be 68, while xen-net{front|back} drivers use a minimum value of 0. When set MTU to 0~67 with xen_net{front|back} driver, the network will become unreachable immediately, the guest can no longer be pinged. xen_net{front|back} should not allow the user to set this value which causes network problems. Reported-by: Chen Shi <[email protected]> Signed-off-by: Mohammed Gamal <[email protected]> Acked-by: Wei Liu <[email protected]> Reviewed-by: Boris Ostrovsky <[email protected]> Signed-off-by: Boris Ostrovsky <[email protected]>
1 parent eac779a commit e1043a4

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

drivers/net/xen-netback/interface.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -486,7 +486,7 @@ struct xenvif *xenvif_alloc(struct device *parent, domid_t domid,
486486

487487
dev->tx_queue_len = XENVIF_QUEUE_LENGTH;
488488

489-
dev->min_mtu = 0;
489+
dev->min_mtu = ETH_MIN_MTU;
490490
dev->max_mtu = ETH_MAX_MTU - VLAN_ETH_HLEN;
491491

492492
/*

drivers/net/xen-netfront.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1316,7 +1316,7 @@ static struct net_device *xennet_create_dev(struct xenbus_device *dev)
13161316
netdev->features |= netdev->hw_features;
13171317

13181318
netdev->ethtool_ops = &xennet_ethtool_ops;
1319-
netdev->min_mtu = 0;
1319+
netdev->min_mtu = ETH_MIN_MTU;
13201320
netdev->max_mtu = XEN_NETIF_MAX_TX_SIZE;
13211321
SET_NETDEV_DEV(netdev, &dev->dev);
13221322

0 commit comments

Comments
 (0)