lib/flow: add dp_hash and recirc_id to struct flow
[sliver-openvswitch.git] / lib / flow.c
index 00e66a4..f6ec135 100644 (file)
@@ -530,8 +530,10 @@ flow_unwildcard_tp_ports(const struct flow *flow, struct flow_wildcards *wc)
 void
 flow_get_metadata(const struct flow *flow, struct flow_metadata *fmd)
 {
-    BUILD_ASSERT_DECL(FLOW_WC_SEQ == 24);
+    BUILD_ASSERT_DECL(FLOW_WC_SEQ == 25);
 
+    fmd->dp_hash = flow->dp_hash;
+    fmd->recirc_id = flow->recirc_id;
     fmd->tun_id = flow->tunnel.tun_id;
     fmd->tun_src = flow->tunnel.ip_src;
     fmd->tun_dst = flow->tunnel.ip_dst;
@@ -828,10 +830,10 @@ flow_hash_5tuple(const struct flow *flow, uint32_t basis)
         return 0;
     }
 
-    hash = mhash_add(hash, (OVS_FORCE unsigned int) flow->nw_src);
-    hash = mhash_add(basis, (OVS_FORCE unsigned int) flow->nw_dst);
-    hash = mhash_add(hash, ((OVS_FORCE unsigned int) flow->tp_src << 16)
-                           | (OVS_FORCE unsigned int) flow->tp_dst);
+    hash = mhash_add(basis, (OVS_FORCE uint32_t) flow->nw_src);
+    hash = mhash_add(hash, (OVS_FORCE uint32_t) flow->nw_dst);
+    hash = mhash_add(hash, ((OVS_FORCE uint32_t) flow->tp_src << 16)
+                           | (OVS_FORCE uint32_t) flow->tp_dst);
     hash = mhash_add(hash, flow->nw_proto);
 
     return mhash_finish(hash, 13);
@@ -1194,7 +1196,7 @@ flow_push_mpls(struct flow *flow, int n, ovs_be16 mpls_eth_type,
         flow->mpls_lse[0] = set_mpls_lse_values(ttl, tc, 1, htonl(label));
 
         /* Clear all L3 and L4 fields. */
-        BUILD_ASSERT(FLOW_WC_SEQ == 24);
+        BUILD_ASSERT(FLOW_WC_SEQ == 25);
         memset((char *) flow + FLOW_SEGMENT_2_ENDS_AT, 0,
                sizeof(struct flow) - FLOW_SEGMENT_2_ENDS_AT);
     }