net: sched: act_csum: Fix csum calc for tagged packets
authorEli Britstein <elibr@mellanox.com>
Tue, 26 Feb 2019 09:57:34 +0000 (09:57 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 27 Jan 2020 13:50:29 +0000 (14:50 +0100)
commit3764bfae5056e95617b6ee074129297e11710886
tree811cfd628005540bad79cc92b958916cf2f98128
parentabbfc53d999d20299906903d71c6607158f9c814
net: sched: act_csum: Fix csum calc for tagged packets

[ Upstream commit 2ecba2d1e45b24620a7c3df9531895cf68d5dec6 ]

The csum calculation is different for IPv4/6. For VLAN packets,
tc_skb_protocol returns the VLAN protocol rather than the packet's one
(e.g. IPv4/6), so csum is not calculated. Furthermore, VLAN may not be
stripped so csum is not calculated in this case too. Calculate the
csum for those cases.

Fixes: d8b9605d2697 ("net: sched: fix skb->protocol use in case of accelerated vlan path")
Signed-off-by: Eli Britstein <elibr@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/sched/act_csum.c