diff options
author | Marcelo Ricardo Leitner <marcelo.leitner@gmail.com> | 2021-03-22 21:13:22 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2021-03-24 00:32:26 +0300 |
commit | 8ca1b090e5c9a71abeea1dda8757f4ec3811f06e (patch) | |
tree | 916219d235503e2c08c82a4e3c1d90ef848fff7b /samples/binderfs | |
parent | e0c755a45f6fb6e81e3a62a94db0400ef0cdc046 (diff) | |
download | linux-8ca1b090e5c9a71abeea1dda8757f4ec3811f06e.tar.xz |
net/sched: act_ct: clear post_ct if doing ct_clear
Invalid detection works with two distinct moments: act_ct tries to find
a conntrack entry and set post_ct true, indicating that that was
attempted. Then, when flow dissector tries to dissect CT info and no
entry is there, it knows that it was tried and no entry was found, and
synthesizes/sets
key->ct_state = TCA_FLOWER_KEY_CT_FLAGS_TRACKED |
TCA_FLOWER_KEY_CT_FLAGS_INVALID;
mimicing what OVS does.
OVS has this a bit more streamlined, as it recomputes the key after
trying to find a conntrack entry for it.
Issue here is, when we have 'tc action ct clear', it didn't clear
post_ct, causing a subsequent match on 'ct_state -trk' to fail, due to
the above. The fix, thus, is to clear it.
Reproducer rules:
tc filter add dev enp130s0f0np0_0 ingress prio 1 chain 0 \
protocol ip flower ip_proto tcp ct_state -trk \
action ct zone 1 pipe \
action goto chain 2
tc filter add dev enp130s0f0np0_0 ingress prio 1 chain 2 \
protocol ip flower \
action ct clear pipe \
action goto chain 4
tc filter add dev enp130s0f0np0_0 ingress prio 1 chain 4 \
protocol ip flower ct_state -trk \
action mirred egress redirect dev enp130s0f1np1_0
With the fix, the 3rd rule matches, like it does with OVS kernel
datapath.
Fixes: 7baf2429a1a9 ("net/sched: cls_flower add CT_FLAGS_INVALID flag support")
Signed-off-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Reviewed-by: wenxu <wenxu@ucloud.cn>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'samples/binderfs')
0 files changed, 0 insertions, 0 deletions