Skip to content

Commit 11387fe

Browse files
erig0davem330
authored andcommitted
geneve: fix fill_info when using collect_metadata
Since 9b4437a ("geneve: Unify LWT and netdev handling.") fill_info does not return UDP_ZERO_CSUM6_RX when using COLLECT_METADATA. This is because it uses ip_tunnel_info_af() with the device level info, which is not valid for COLLECT_METADATA. Fix by checking for the presence of the actual sockets. Fixes: 9b4437a ("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>
1 parent e6a88e4 commit 11387fe

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

drivers/net/geneve.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1293,7 +1293,7 @@ static int geneve_fill_info(struct sk_buff *skb, const struct net_device *dev)
12931293
if (nla_put_u32(skb, IFLA_GENEVE_ID, vni))
12941294
goto nla_put_failure;
12951295

1296-
if (ip_tunnel_info_af(info) == AF_INET) {
1296+
if (rtnl_dereference(geneve->sock4)) {
12971297
if (nla_put_in_addr(skb, IFLA_GENEVE_REMOTE,
12981298
info->key.u.ipv4.dst))
12991299
goto nla_put_failure;
@@ -1302,8 +1302,10 @@ static int geneve_fill_info(struct sk_buff *skb, const struct net_device *dev)
13021302
!!(info->key.tun_flags & TUNNEL_CSUM)))
13031303
goto nla_put_failure;
13041304

1305+
}
1306+
13051307
#if IS_ENABLED(CONFIG_IPV6)
1306-
} else {
1308+
if (rtnl_dereference(geneve->sock6)) {
13071309
if (nla_put_in6_addr(skb, IFLA_GENEVE_REMOTE6,
13081310
&info->key.u.ipv6.dst))
13091311
goto nla_put_failure;
@@ -1315,8 +1317,8 @@ static int geneve_fill_info(struct sk_buff *skb, const struct net_device *dev)
13151317
if (nla_put_u8(skb, IFLA_GENEVE_UDP_ZERO_CSUM6_RX,
13161318
!geneve->use_udp6_rx_checksums))
13171319
goto nla_put_failure;
1318-
#endif
13191320
}
1321+
#endif
13201322

13211323
if (nla_put_u8(skb, IFLA_GENEVE_TTL, info->key.ttl) ||
13221324
nla_put_u8(skb, IFLA_GENEVE_TOS, info->key.tos) ||

0 commit comments

Comments
 (0)