mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs.git
synced 2026-10-31 06:14:39 +01:00
net/sched: act_ct: Offload connections with commit action
Currently established connections are not offloaded if the filter has a
"ct commit" action. This behavior will not offload connections of the
following scenario:
$ tc_filter add dev $DEV ingress protocol ip prio 1 flower \
ct_state -trk \
action ct commit action goto chain 1
$ tc_filter add dev $DEV ingress protocol ip chain 1 prio 1 flower \
action mirred egress redirect dev $DEV2
$ tc_filter add dev $DEV2 ingress protocol ip prio 1 flower \
action ct commit action goto chain 1
$ tc_filter add dev $DEV2 ingress protocol ip prio 1 chain 1 flower \
ct_state +trk+est \
action mirred egress redirect dev $DEV
Offload established connections, regardless of the commit flag.
Fixes: 46475bb20f ("net/sched: act_ct: Software offload of established flows")
Reviewed-by: Oz Shlomo <[email protected]>
Reviewed-by: Jiri Pirko <[email protected]>
Acked-by: Marcelo Ricardo Leitner <[email protected]>
Signed-off-by: Paul Blakey <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Jakub Kicinski <[email protected]>
This commit is contained in:
1 parent
b28d8f0c25
commit
0cc254e5aa
1 file changed
+4
-3
+4
-3
@@ -984,7 +984,7 @@ static int tcf_ct_act(struct sk_buff *skb, const struct tc_action *a,
|
||||
*/
|
||||
cached = tcf_ct_skb_nfct_cached(net, skb, p->zone, force);
|
||||
if (!cached) {
|
||||
if (!commit && tcf_ct_flow_table_lookup(p, skb, family)) {
|
||||
if (tcf_ct_flow_table_lookup(p, skb, family)) {
|
||||
skip_add = true;
|
||||
goto do_nat;
|
||||
}
|
||||
@@ -1022,10 +1022,11 @@ do_nat:
|
||||
* even if the connection is already confirmed.
|
||||
*/
|
||||
nf_conntrack_confirm(skb);
|
||||
} else if (!skip_add) {
|
||||
tcf_ct_flow_table_process_conn(p->ct_ft, ct, ctinfo);
|
||||
}
|
||||
|
||||
if (!skip_add)
|
||||
tcf_ct_flow_table_process_conn(p->ct_ft, ct, ctinfo);
|
||||
|
||||
out_push:
|
||||
skb_push_rcsum(skb, nh_ofs);
|
||||
|
||||
|
||||
Reference in new issue
Block a user