diff options
author | Ralf Baechle <ralf@linux-mips.org> | 2016-08-03 12:55:49 +0200 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2016-08-03 12:55:49 +0200 |
commit | 4a89cf810130fde41e3fc729e770cb1a5a87d245 (patch) | |
tree | 84da40f8d26e51c21e61fc4fc5b7242c0050ae7d /drivers/net/geneve.c | |
parent | MIPS: mm: Fix definition of R6 cache instruction (diff) | |
parent | MIPS: Fix MSA asm warnings in control reg accessors (diff) | |
download | linux-4a89cf810130fde41e3fc729e770cb1a5a87d245.tar.xz linux-4a89cf810130fde41e3fc729e770cb1a5a87d245.zip |
Merge branch '4.7-fixes' into mips-for-linux-next
Diffstat (limited to 'drivers/net/geneve.c')
-rw-r--r-- | drivers/net/geneve.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/net/geneve.c b/drivers/net/geneve.c index cc39cefeae45..9b3dc3c61e00 100644 --- a/drivers/net/geneve.c +++ b/drivers/net/geneve.c @@ -1072,12 +1072,17 @@ 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, bool strict) { + struct geneve_dev *geneve = netdev_priv(dev); /* The max_mtu calculation does not take account of GENEVE * options, to avoid excluding potentially valid * configurations. */ - int max_mtu = IP_MAX_MTU - GENEVE_BASE_HLEN - sizeof(struct iphdr) - - dev->hard_header_len; + int max_mtu = IP_MAX_MTU - GENEVE_BASE_HLEN - dev->hard_header_len; + + if (geneve->remote.sa.sa_family == AF_INET6) + max_mtu -= sizeof(struct ipv6hdr); + else + max_mtu -= sizeof(struct iphdr); if (new_mtu < 68) return -EINVAL; |