2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-31 14:25:26 +00:00

lib/flow: Fix flow_hash_5tuple().

First part of the hash was discarded as basis was used too late.

Also be explicit about the input type expected by mhash_add().

Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Signed-off-by: Alex Wang <alexw@nicira.com>
This commit is contained in:
Jarno Rajahalme
2014-03-24 17:34:48 -07:00
parent fc3431c6a0
commit 5382a3cf9b

View File

@@ -828,10 +828,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);