]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
tc: flower: Add support for ct_state reply flag
authorPaul Blakey <paulb@nvidia.com>
Tue, 2 Feb 2021 12:24:42 +0000 (14:24 +0200)
committerDavid Ahern <dsahern@kernel.org>
Fri, 5 Feb 2021 04:54:28 +0000 (21:54 -0700)
Matches on conntrack rpl ct_state.

Example:
$ tc filter add dev ens1f0_0 ingress prio 1 chain 1 proto ip flower \
  ct_state +trk+est+rpl \
  action mirred egress redirect dev ens1f0_1
$ tc filter add dev ens1f0_1 ingress prio 1 chain 1 proto ip flower \
  ct_state +trk+est-rpl \
  action mirred egress redirect dev ens1f0_0

Signed-off-by: Paul Blakey <paulb@nvidia.com>
Signed-off-by: David Ahern <dsahern@kernel.org>
man/man8/tc-flower.8
tc/f_flower.c

index 226d1cc656311eeb5583eacf22f912e804feac70..f7336b62ca1dcd39420731a138fb2c4cb2020cc9 100644 (file)
@@ -387,6 +387,8 @@ new - New connection.
 .TP
 est - Established connection.
 .TP
+rpl - The packet is in the reply direction, meaning that it is in the opposite direction from the packet that initiated the connection.
+.TP
 inv - The state is invalid. The packet couldn't be associated to a connection.
 .TP
 Example: +trk+est
index 85c1043a72be4d4e61b753c4f6084a8c5a5e6941..53822a954c9e4534cb46eda389a3c08809ecba7c 100644 (file)
@@ -346,6 +346,7 @@ static struct flower_ct_states {
        { "new", TCA_FLOWER_KEY_CT_FLAGS_NEW },
        { "est", TCA_FLOWER_KEY_CT_FLAGS_ESTABLISHED },
        { "inv", TCA_FLOWER_KEY_CT_FLAGS_INVALID },
+       { "rpl", TCA_FLOWER_KEY_CT_FLAGS_REPLY },
 };
 
 static int flower_parse_ct_state(char *str, struct nlmsghdr *n)