tc: Add missing ct_state flags
Subsystems (2)
cover tc: Add missing ct_state flags
This short series is:
1. Adding support for matching on ct_state flag rel in tc flower classifier.
2. Adding some missing description of ct_state flags rpl and inv.
Ariel Levkovich (2):
tc: f_flower: Add option to match on related ct state
tc: f_flower: Add missing ct_state flags to usage description
man/man8/tc-flower.8 | 2 ++ tc/f_flower.c | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-)
Signature · 1 line
2.25.2
PATCH 1/2 tc: f_flower: Add option to match on related ct state
Add support for matching on ct_state flag related.
The related state indicates a packet is associated with an existing connection.
Example:
$ tc filter add dev ens1f0_0 ingress prio 1 chain 1 proto ip flower \ ct_state -est-rel+trk \ action mirred egress redirect dev ens1f0_1
$ tc filter add dev ens1f0_0 ingress prio 1 chain 1 proto ip flower \ ct_state +rel+trk \ action mirred egress redirect dev ens1f0_1
--- man/man8/tc-flower.8 | 2 ++ tc/f_flower.c | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-)
man/man8/tc-flower.8 +2 -0
@@ -391,6 +391,8 @@ rpl - The packet is in the reply direction, meaning that it is in the opposite d .TP inv - The state is invalid. The packet couldn't be associated to a connection. .TP +rel - The packet is related to an existing connection. +.TP Example: +trk+est .RE .TP
tc/f_flower.c +2 -1
@@ -94,7 +94,7 @@ static void explain(void)" LSE := lse depth DEPTH { label LABEL | tc TC | bos BOS | ttl TTL }\n" " FILTERID := X:Y:Z\n" " MASKED_LLADDR := { LLADDR | LLADDR/MASK | LLADDR/BITS }\n" -" MASKED_CT_STATE := combination of {+|-} and flags trk,est,new\n" +" MASKED_CT_STATE := combination of {+|-} and flags trk,est,new,rel\n" " ACTION-SPEC := ... look at individual actions\n" "\n" "NOTE: CLASSID, IP-PROTO are parsed as hexadecimal input.\n"
@@ -345,6 +345,7 @@ static struct flower_ct_states { { "trk", TCA_FLOWER_KEY_CT_FLAGS_TRACKED }, { "new", TCA_FLOWER_KEY_CT_FLAGS_NEW }, { "est", TCA_FLOWER_KEY_CT_FLAGS_ESTABLISHED }, + { "rel", TCA_FLOWER_KEY_CT_FLAGS_RELATED }, { "inv", TCA_FLOWER_KEY_CT_FLAGS_INVALID }, { "rpl", TCA_FLOWER_KEY_CT_FLAGS_REPLY }, };
Signature · 1 line
2.25.2
PATCH 2/2 tc: f_flower: Add missing ct_state flags to usage description
In reply to Ariel LevkovichAdd ct_state flags rpl and inv to the commands usage description
--- tc/f_flower.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tc/f_flower.c +1 -1
@@ -94,7 +94,7 @@ static void explain(void)" LSE := lse depth DEPTH { label LABEL | tc TC | bos BOS | ttl TTL }\n" " FILTERID := X:Y:Z\n" " MASKED_LLADDR := { LLADDR | LLADDR/MASK | LLADDR/BITS }\n" -" MASKED_CT_STATE := combination of {+|-} and flags trk,est,new,rel\n" +" MASKED_CT_STATE := combination of {+|-} and flags trk,est,new,rel,rpl,inv\n" " ACTION-SPEC := ... look at individual actions\n" "\n" "NOTE: CLASSID, IP-PROTO are parsed as hexadecimal input.\n"
Signature · 1 line
2.25.2
David Ahern
AppliedQuoted 7 lines · Ariel Levkovich
This short series is:
1. Adding support for matching on
ct_stateflag rel in tc flower classifier.2. Adding some missing description of
ct_stateflags rpl and inv.
Quoted 8 lines
Ariel Levkovich (2):
tc:f_flower: Add option to match on related ct state
tc:f_flower: Add missingct_stateflags to usage descriptionman/man8/tc-flower.8 | 2 ++ tc/f_flower.c | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-)
applied both to iproute-next.