geneve: fix fill_info when using collect_metadata
Subsystems (2)
PATCH 1/1 geneve: fix fill_info when using collect_metadata
Since 9b4437a5b870 ("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.
--- drivers/net/geneve.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
drivers/net/geneve.c +5 -3
@@ -1293,7 +1293,7 @@ static int geneve_fill_info(struct sk_buff *skb, const struct net_device *dev)if (nla_put_u32 (skb,IFLA_GENEVE_ID , vni)) goto nla_put_failure; -if (ip_tunnel_info_af (info) ==AF_INET ) { +if (rtnl_dereference (geneve->sock4)) {if (nla_put_in_addr (skb,IFLA_GENEVE_REMOTE , info->key.u.ipv4.dst)) goto nla_put_failure;
@@ -1302,8 +1302,10 @@ static int geneve_fill_info(struct sk_buff *skb, const struct net_device *dev) !!(info->key.tun_flags & TUNNEL_CSUM))) goto nla_put_failure; + } +#if IS_ENABLED (CONFIG_IPV6 ) - } else { +if (rtnl_dereference (geneve->sock6)) {if (nla_put_in6_addr (skb,IFLA_GENEVE_REMOTE6 , &info->key.u.ipv6.dst)) goto nla_put_failure;
@@ -1315,8 +1317,8 @@ static int geneve_fill_info(struct sk_buff *skb, const struct net_device *dev)if (nla_put_u8 (skb,IFLA_GENEVE_UDP_ZERO_CSUM6_RX , !geneve->use_udp6_rx_checksums)) goto nla_put_failure; -#endif } +#endif if (nla_put_u8(skb, IFLA_GENEVE_TTL, info->key.ttl) || nla_put_u8(skb, IFLA_GENEVE_TOS, info->key.tos) ||
Signature · 1 line
2.12.0
Quoted 9 lines · Eric Garver
Since
9b4437a5b870("geneve: Unify LWT and netdev handling.")fill_infodoes not returnUDP_ZERO_CSUM6_RXwhen usingCOLLECT_METADATA. This is because it usesip_tunnel_info_af()with the device level info, which is not valid forCOLLECT_METADATA.Fix by checking for the presence of the actual sockets.
Fixes 9b4437a5b870 ("geneve: Unify LWT and netdev handling.")Signed-off-by Eric Garver <[email protected]>
Thanks for the patch.
I noticed that the MTU and encal_len calculation in geneve_configure() also needs to be fixed for collect metadata case. Can you send patch to fix it?
Quoted 10 lines · Pravin Shelar
Quoted 9 lines · Eric Garver
Since
9b4437a5b870("geneve: Unify LWT and netdev handling.")fill_infodoes not returnUDP_ZERO_CSUM6_RXwhen usingCOLLECT_METADATA. This is because it usesip_tunnel_info_af()with the device level info, which is not valid forCOLLECT_METADATA.Fix by checking for the presence of the actual sockets.
Fixes 9b4437a5b870 ("geneve: Unify LWT and netdev handling.")Signed-off-by Eric Garver <[email protected]>
Quoted 8 lines
Thanks for the patch.
Acked-by Pravin B Shelar <[email protected]>I noticed that the MTU and
encal_lencalculation ingeneve_configure()also needs to be fixed for collect metadata case. Can you send patch to fix it?
Ah, yes. I'll take a look at those as well.
Eric.
David Miller
maintainerFrom: Eric Garver <[email protected]>
Date: Tue, 23 May 2017 18:37:27 -0400
Quoted 9 lines
Since
9b4437a5b870("geneve: Unify LWT and netdev handling.")fill_infodoes not returnUDP_ZERO_CSUM6_RXwhen usingCOLLECT_METADATA. This is because it usesip_tunnel_info_af()with the device level info, which is not valid forCOLLECT_METADATA.Fix by checking for the presence of the actual sockets.
Fixes 9b4437a5b870 ("geneve: Unify LWT and netdev handling.")Signed-off-by Eric Garver <[email protected]>
Please target bug fixes at 'net' not 'net-next' unless the bug only exists in 'net-next'.
I've applied this to 'net' and queued it up for -stable.