[ovs-dev] [patch_v1] flow.c: refactor ct_orig_tuple check in miniflow_extract.

Darrell Ball dlu998 at gmail.com
Sat May 20 18:09:38 UTC 2017


The checks to populate ct_orig_tuple in miniflow_extract
includes recirc_id being non-zero.  This is changed here
to populate the ct_orig_tuple fields based only on ct_state
per the logic of the design.

Signed-off-by: Darrell Ball <dlu998 at gmail.com>
---
 lib/flow.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/lib/flow.c b/lib/flow.c
index 7f98a46..5ef783a 100644
--- a/lib/flow.c
+++ b/lib/flow.c
@@ -615,12 +615,15 @@ miniflow_extract(struct dp_packet *packet, struct miniflow *dst)
     }
     miniflow_push_uint32(mf, dp_hash, md->dp_hash);
     miniflow_push_uint32(mf, in_port, odp_to_u32(md->in_port.odp_port));
-    if (md->recirc_id || md->ct_state) {
+    if (md->ct_state) {
         miniflow_push_uint32(mf, recirc_id, md->recirc_id);
         miniflow_push_uint8(mf, ct_state, md->ct_state);
         ct_nw_proto_p = miniflow_pointer(mf, ct_nw_proto);
         miniflow_push_uint8(mf, ct_nw_proto, 0);
         miniflow_push_uint16(mf, ct_zone, md->ct_zone);
+    } else if (md->recirc_id) {
+        miniflow_push_uint32(mf, recirc_id, md->recirc_id);
+        miniflow_pad_to_64(mf, recirc_id);
     }
 
     if (md->ct_state) {
-- 
1.9.1



More information about the dev mailing list