tc: flower: add tc conntrack inv ct_state support
Subsystems (3)
PATCH v2 1/1 tc: flower: add tc conntrack inv ct_state support
From: wenxu <[email protected]>
Matches on conntrack inv ct_state.
Signed-off-by wenxu <[email protected]>
---
v2: change the description
include/uapi/linux/pkt_cls.h | 1 + man/man8/tc-flower.8 | 2 ++ tc/f_flower.c | 1 + 3 files changed, 4 insertions(+)
include/uapi/linux/pkt_cls.h +1 -0
@@ -563,6 +563,7 @@ enum {TCA_FLOWER_KEY_CT_FLAGS_ESTABLISHED =1 <<1 ,/* Part of an existing connection. */ TCA_FLOWER_KEY_CT_FLAGS_RELATED =1 <<2 ,/* Related to an established connection. */ TCA_FLOWER_KEY_CT_FLAGS_TRACKED =1 <<3 ,/* Conntrack has occurred. */ + TCA_FLOWER_KEY_CT_FLAGS_INVALID = 1 << 4, /* Conntrack is invalid. */ }; enum {
man/man8/tc-flower.8 +2 -0
@@ -312,6 +312,8 @@ new - New connection. .TP est - Established connection. .TP +inv - The state is invalid. The packet couldn't be associated to a connection. +.TP Example: +trk+est .RE .TP
tc/f_flower.c +1 -0
@@ -340,6 +340,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 }, + { "inv", TCA_FLOWER_KEY_CT_FLAGS_INVALID}, };static int flower_parse_ct_state (char *str,struct nlmsghdr *n)
Signature · 1 line
1.8.3.1
tc/f_flower.c static struct flower_ct_states { · line 343
Quoted 6 lines · On Wed, Jan 20, 2021 at 10:52:12AM +0800, [email protected] wrote:
+++
b/tc/f_flower.ctc/f_flower.c +1
-0@@ -340,6 +340,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 }, + { "inv", TCA_FLOWER_KEY_CT_FLAGS_INVALID},
Sorry for the late nit picking but, missing a ^^ space here.
Otherwise, LGTM.
Quoted 44 lines · On 1/19/21 7:52 PM, [email protected] wrote:
From: wenxu <[email protected]>
Matches on conntrack inv
ct_state.Signed-off-by wenxu <[email protected]>---
v2: change the descriptioninclude/uapi/linux/pkt_cls.h | 1 + man/man8/tc-flower.8 | 2 ++ tc/f_flower.c | 1 + 3 files changed, 4 insertions(+)include/uapi/linux/pkt_cls.h +1
-0@@ -563,6 +563,7 @@ enum {TCA_FLOWER_KEY_CT_FLAGS_ESTABLISHED =1 <<1 ,/* Part of an existing connection. */ TCA_FLOWER_KEY_CT_FLAGS_RELATED =1 <<2 ,/* Related to an established connection. */ TCA_FLOWER_KEY_CT_FLAGS_TRACKED =1 <<3 ,/* Conntrack has occurred. */ + TCA_FLOWER_KEY_CT_FLAGS_INVALID = 1 << 4, /* Conntrack is invalid. */ }; enum {man/man8/tc-flower.8 +2
-0@@ -312,6 +312,8 @@ new - New connection. .TP est - Established connection. .TP +inv - The state is invalid. The packet couldn't be associated to a connection. +.TP Example: +trk+est .RE .TPtc/f_flower.c +0
-0
tc/f_flower.c static struct flower_ct_states { · line 346
Quoted 7 lines
tc/f_flower.c +1
-0@@ -340,6 +340,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 }, + { "inv", TCA_FLOWER_KEY_CT_FLAGS_INVALID}, };static int flower_parse_ct_state (char *str,struct nlmsghdr *n)
Fixed the space and applied to iproute2-next.