[PATCH iproute2-next v2] tc: flower: add tc conntrack inv ct_state support

Subsystems: tc subsystem, the rest

STALE2029d

3 messages, 3 authors, 2021-01-23 · open the first message on its own page

[PATCH iproute2-next v2] tc: flower: add tc conntrack inv ct_state support

From: <hidden>
Date: 2021-01-20 03:11:20

From: wenxu <redacted>

Matches on conntrack inv ct_state.

Signed-off-by: wenxu <redacted>
---
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(+)
diff --git a/include/uapi/linux/pkt_cls.h b/include/uapi/linux/pkt_cls.h
index 449a639..e8f2aed 100644
--- a/include/uapi/linux/pkt_cls.h
+++ b/include/uapi/linux/pkt_cls.h
@@ -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 {
diff --git a/man/man8/tc-flower.8 b/man/man8/tc-flower.8
index eb9eb5f..f90117b 100644
--- a/man/man8/tc-flower.8
+++ b/man/man8/tc-flower.8
@@ -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
diff --git a/tc/f_flower.c b/tc/f_flower.c
index 9d59d71..7d2df9d 100644
--- a/tc/f_flower.c
+++ b/tc/f_flower.c
@@ -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)
-- 
1.8.3.1

Re: [PATCH iproute2-next v2] tc: flower: add tc conntrack inv ct_state support

From: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Date: 2021-01-20 16:27:33

On Wed, Jan 20, 2021 at 10:52:12AM +0800, wenxu@ucloud.cn wrote:
quoted hunk
+++ b/tc/f_flower.c
@@ -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.

Re: [PATCH iproute2-next v2] tc: flower: add tc conntrack inv ct_state support

From: David Ahern <hidden>
Date: 2021-01-23 18:18:25

On 1/19/21 7:52 PM, wenxu@ucloud.cn wrote:
quoted hunk
From: wenxu <redacted>

Matches on conntrack inv ct_state.

Signed-off-by: wenxu <redacted>
---
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(+)
diff --git a/include/uapi/linux/pkt_cls.h b/include/uapi/linux/pkt_cls.h
index 449a639..e8f2aed 100644
--- a/include/uapi/linux/pkt_cls.h
+++ b/include/uapi/linux/pkt_cls.h
@@ -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 {
diff --git a/man/man8/tc-flower.8 b/man/man8/tc-flower.8
index eb9eb5f..f90117b 100644
--- a/man/man8/tc-flower.8
+++ b/man/man8/tc-flower.8
@@ -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
diff --git a/tc/f_flower.c b/tc/f_flower.c
index 9d59d71..7d2df9d 100644
--- a/tc/f_flower.c
+++ b/tc/f_flower.c
@@ -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.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help