diff mbox series

[ovs-dev] netdev-offload-tc: UNSUPPORT for the OVS_CS_F_INVALID ct_state flag

Message ID 1610344573-15780-1-git-send-email-wenxu@ucloud.cn
State Changes Requested
Headers show
Series [ovs-dev] netdev-offload-tc: UNSUPPORT for the OVS_CS_F_INVALID ct_state flag | expand

Commit Message

wenxu Jan. 11, 2021, 5:56 a.m. UTC
From: wenxu <wenxu@ucloud.cn>

TC flower do't support the INVALID ct state flag. So it is better
to reject this rule but not just ignore this flag.

Signed-off-by: wenxu <wenxu@ucloud.cn>
---
 lib/netdev-offload-tc.c | 4 ++++
 1 file changed, 4 insertions(+)
diff mbox series

Patch

diff --git a/lib/netdev-offload-tc.c b/lib/netdev-offload-tc.c
index 717a987..9b277b0 100644
--- a/lib/netdev-offload-tc.c
+++ b/lib/netdev-offload-tc.c
@@ -1651,6 +1651,10 @@  netdev_tc_flow_put(struct netdev *netdev, struct match *match,
     }
 
     if (mask->ct_state) {
+        if (mask->ct_state & OVS_CS_F_INVALID) {
+            return EOPNOTSUPP;
+        }
+
         if (mask->ct_state & OVS_CS_F_NEW) {
             if (key->ct_state & OVS_CS_F_NEW) {
                 flower.key.ct_state |= TCA_FLOWER_KEY_CT_FLAGS_NEW;