From: Tonghao Zhang <[email protected]>

The max number of mark is (UINT32_MAX - 1), that is
enough to be used. But theoretically, if there are no
mark available, the later different flows will shared
the mark INVALID_FLOW_MARK, that may break the function.
If there are no available mark to be used, return error
code.

Cc: Yuanhan Liu <[email protected]>
Cc: Ian Stokes <[email protected]>
Cc: Ben Pfaff <[email protected]>
Cc: William Tu <[email protected]>
Signed-off-by: Tonghao Zhang <[email protected]>
---
 lib/dpif-netdev.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c
index 25c4b960857a..a001e5b4ea4a 100644
--- a/lib/dpif-netdev.c
+++ b/lib/dpif-netdev.c
@@ -2426,6 +2426,7 @@ dp_netdev_flow_offload_put(struct dp_flow_offload_item 
*offload)
         mark = flow_mark_alloc();
         if (mark == INVALID_FLOW_MARK) {
             VLOG_ERR("Failed to allocate flow mark!\n");
+            return -1;
         }
     }
     info.flow_mark = mark;
-- 
2.26.1

_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to