diff options
Diffstat (limited to 'net/ipv6/ip6_tunnel.c')
| -rw-r--r-- | net/ipv6/ip6_tunnel.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/net/ipv6/ip6_tunnel.c b/net/ipv6/ip6_tunnel.c index a791552e0422..583b77e2f69b 100644 --- a/net/ipv6/ip6_tunnel.c +++ b/net/ipv6/ip6_tunnel.c | |||
| @@ -1430,9 +1430,17 @@ ip6_tnl_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) | |||
| 1430 | static int | 1430 | static int |
| 1431 | ip6_tnl_change_mtu(struct net_device *dev, int new_mtu) | 1431 | ip6_tnl_change_mtu(struct net_device *dev, int new_mtu) |
| 1432 | { | 1432 | { |
| 1433 | if (new_mtu < IPV6_MIN_MTU) { | 1433 | struct ip6_tnl *tnl = netdev_priv(dev); |
| 1434 | return -EINVAL; | 1434 | |
| 1435 | if (tnl->parms.proto == IPPROTO_IPIP) { | ||
| 1436 | if (new_mtu < 68) | ||
| 1437 | return -EINVAL; | ||
| 1438 | } else { | ||
| 1439 | if (new_mtu < IPV6_MIN_MTU) | ||
| 1440 | return -EINVAL; | ||
| 1435 | } | 1441 | } |
| 1442 | if (new_mtu > 0xFFF8 - dev->hard_header_len) | ||
| 1443 | return -EINVAL; | ||
| 1436 | dev->mtu = new_mtu; | 1444 | dev->mtu = new_mtu; |
| 1437 | return 0; | 1445 | return 0; |
| 1438 | } | 1446 | } |
