]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
geneve: fix needed_headroom and max_mtu for collect_metadata
authorEric Garver <e@erig.me>
Fri, 2 Jun 2017 18:54:10 +0000 (14:54 -0400)
committerDavid S. Miller <davem@davemloft.net>
Mon, 5 Jun 2017 00:03:09 +0000 (20:03 -0400)
Since commit 9b4437a5b870 ("geneve: Unify LWT and netdev handling.")
when using COLLECT_METADATA geneve devices are created with too small of
a needed_headroom and too large of a max_mtu. This is because
ip_tunnel_info_af() is not valid with the device level info when using
COLLECT_METADATA and we mistakenly fall into the IPv4 case.

For COLLECT_METADATA, always use the worst case of ipv6 since both
sockets are created.

Fixes: 9b4437a5b870 ("geneve: Unify LWT and netdev handling.")
Signed-off-by: Eric Garver <e@erig.me>
Acked-by: Pravin B Shelar <pshelar@ovn.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/geneve.c

index 959fd12d2e670dfa52d7d9d11f835e990c82aa7c..6ebb0f559a427fdb4d27d9b668b46d7151650043 100644 (file)
@@ -1133,7 +1133,7 @@ static int geneve_configure(struct net *net, struct net_device *dev,
 
        /* make enough headroom for basic scenario */
        encap_len = GENEVE_BASE_HLEN + ETH_HLEN;
-       if (ip_tunnel_info_af(info) == AF_INET) {
+       if (!metadata && ip_tunnel_info_af(info) == AF_INET) {
                encap_len += sizeof(struct iphdr);
                dev->max_mtu -= sizeof(struct iphdr);
        } else {