net: sched: act_mirred: drop dst for the direction from egress to ingress
authorXin Long <lucien.xin@gmail.com>
Fri, 12 Nov 2021 16:33:11 +0000 (11:33 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 25 Nov 2021 08:48:38 +0000 (09:48 +0100)
commit7cc1c7da94eae9b35517a0a96b0dae2ca382700d
tree4b32085bc70becfd0391bed4931fd465e4490510
parentd7d992cc3a7b3ad3470167dc27b8a6bbc1114c38
net: sched: act_mirred: drop dst for the direction from egress to ingress

[ Upstream commit f799ada6bf2397c351220088b9b0980125c77280 ]

Without dropping dst, the packets sent from local mirred/redirected
to ingress will may still use the old dst. ip_rcv() will drop it as
the old dst is for output and its .input is dst_discard.

This patch is to fix by also dropping dst for those packets that are
mirred or redirected from egress to ingress in act_mirred.

Note that we don't drop it for the direction change from ingress to
egress, as on which there might be a user case attaching a metadata
dst by act_tunnel_key that would be used later.

Fixes: b57dc7c13ea9 ("net/sched: Introduce action ct")
Signed-off-by: Xin Long <lucien.xin@gmail.com>
Acked-by: Cong Wang <cong.wang@bytedance.com>
Reviewed-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/sched/act_mirred.c