Skip to content

Commit 9a1c44d

Browse files
erig0davem330
authored andcommitted
geneve: fix needed_headroom and max_mtu for collect_metadata
Since commit 9b4437a ("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: 9b4437a ("geneve: Unify LWT and netdev handling.") Signed-off-by: Eric Garver <[email protected]> Acked-by: Pravin B Shelar <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 38b2579 commit 9a1c44d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/net/geneve.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1133,7 +1133,7 @@ static int geneve_configure(struct net *net, struct net_device *dev,
11331133

11341134
/* make enough headroom for basic scenario */
11351135
encap_len = GENEVE_BASE_HLEN + ETH_HLEN;
1136-
if (ip_tunnel_info_af(info) == AF_INET) {
1136+
if (!metadata && ip_tunnel_info_af(info) == AF_INET) {
11371137
encap_len += sizeof(struct iphdr);
11381138
dev->max_mtu -= sizeof(struct iphdr);
11391139
} else {

0 commit comments

Comments
 (0)