Commit 321acc1c authored by Alexey Kodanev's avatar Alexey Kodanev Committed by David S. Miller

geneve: check MTU for a minimum in geneve_change_mtu()

geneve_change_mtu() will be used not only as ndo_change_mtu() callback,
but also to verify a user specified MTU on a new link creation in the
next patch.
Signed-off-by: default avatarAlexey Kodanev <alexey.kodanev@oracle.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 5edbea69
...@@ -942,11 +942,10 @@ static netdev_tx_t geneve_xmit(struct sk_buff *skb, struct net_device *dev) ...@@ -942,11 +942,10 @@ static netdev_tx_t geneve_xmit(struct sk_buff *skb, struct net_device *dev)
static int geneve_change_mtu(struct net_device *dev, int new_mtu) static int geneve_change_mtu(struct net_device *dev, int new_mtu)
{ {
/* Only possible if called internally, ndo_change_mtu path's new_mtu
* is guaranteed to be between dev->min_mtu and dev->max_mtu.
*/
if (new_mtu > dev->max_mtu) if (new_mtu > dev->max_mtu)
new_mtu = dev->max_mtu; new_mtu = dev->max_mtu;
else if (new_mtu < dev->min_mtu)
new_mtu = dev->min_mtu;
dev->mtu = new_mtu; dev->mtu = new_mtu;
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment