ip6_tunnel: Fix usage of skb_vlan_inet_prepare()
PATCH 1/1 ip6_tunnel: Fix usage of skb_vlan_inet_prepare()
Backports of commit 81c734dae203 "ip6_tunnel: use skb_vlan_inet_prepare() in __ip6_tnl_rcv()" broke IPv6 tunnelling in stable branches 5.10-6.12 inclusive. This is because the return value of skb_vlan_inet_prepare() had the opposite sense (0 for error rather than for success) before commit 9990ddf47d416 "net: tunnel: make skb_vlan_inet_prepare() return drop reasons".
For branches including commit c504e5c2f964 "net: skb: introduce kfree_skb_reason()" etc. (i.e. 6.1 and newer) it was simple to backport commit 9990ddf47d416, but for 5.10 and 5.15 that doesn't seem to be practical.
So just reverse the sense of the return value test here.
---
I built and tested 5.10.251 with this on top, but have not tested it with the 5.15 branch.
Ben.
net/ipv6/ip6_tunnel.c +1 -1
@@ -876,7 +876,7 @@ static int __ip6_tnl_rcv(struct ip6_tnlskb_reset_network_header (skb); -if (skb_vlan_inet_prepare (skb, true)) { +if (!skb_vlan_inet_prepare (skb, true)) {DEV_STATS_INC (tunnel->dev, rx_length_errors);DEV_STATS_INC (tunnel->dev, rx_errors); goto drop;