Thread (13 messages) flat view 13 messages, 4 authors, 2021-09-24
STALE1808d

[PATCH net 2/2] net: sched: also drop dst for the packets toward ingress in act_mirred

From: Xin Long <lucien.xin@gmail.com>
Date: 2021-09-20 10:19:33
Subsystem: networking [general], tc subsystem, the rest · Maintainers: "David S. Miller", Eric Dumazet, Jakub Kicinski, Paolo Abeni, Jamal Hadi Salim, Jiri Pirko, Linus Torvalds

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 to ingress in act_mirred.

Fixes: b57dc7c13ea9 ("net/sched: Introduce action ct")
Signed-off-by: Xin Long <lucien.xin@gmail.com>
---
 net/sched/act_mirred.c | 2 ++
 1 file changed, 2 insertions(+)
diff --git a/net/sched/act_mirred.c b/net/sched/act_mirred.c
index 46dff1f1e7c8..5e30b3e64b63 100644
--- a/net/sched/act_mirred.c
+++ b/net/sched/act_mirred.c
@@ -19,6 +19,7 @@
 #include <linux/if_arp.h>
 #include <net/net_namespace.h>
 #include <net/netlink.h>
+#include <net/dst.h>
 #include <net/pkt_sched.h>
 #include <net/pkt_cls.h>
 #include <linux/tc_act/tc_mirred.h>
@@ -209,6 +210,7 @@ static int tcf_mirred_forward(bool want_ingress, struct sk_buff *skb)
 		return tcf_dev_queue_xmit(skb, dev_queue_xmit);
 
 	nf_reset_ct(skb);
+	skb_dst_drop(skb);
 
 	return netif_receive_skb(skb);
 }
-- 
2.27.0
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help