summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDarrell Ball <dlu998@gmail.com>2017-06-09 15:30:44 -0700
committerBen Pfaff <blp@ovn.org>2017-06-12 22:08:00 -0700
commit6b1d46253362c0bad844cedf93e22e7bf94d55dc (patch)
tree4d40405ad585e2472c70956281a9f0a9565f162c /lib
parent92edd073ce6ca72636600a64e0645bf23027660a (diff)
downloadopenvswitch-6b1d46253362c0bad844cedf93e22e7bf94d55dc.tar.gz
conntrack: Add hash_finish() to conn_key_hash().
The function conn_key_hash() is updated to include a call to hash_finish() and also to make use of a new hash abstraction - ct_endpoint_hash_add(). Fixes: a489b16854b5 ("conntrack: New userspace connection tracker.") Signed-off-by: Darrell Ball <dlu998@gmail.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/conntrack.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/lib/conntrack.c b/lib/conntrack.c
index 9584a0a35..146edd700 100644
--- a/lib/conntrack.c
+++ b/lib/conntrack.c
@@ -1529,14 +1529,10 @@ static uint32_t
conn_key_hash(const struct conn_key *key, uint32_t basis)
{
uint32_t hsrc, hdst, hash;
- int i;
hsrc = hdst = basis;
-
- for (i = 0; i < sizeof(key->src) / sizeof(uint32_t); i++) {
- hsrc = hash_add(hsrc, ((uint32_t *) &key->src)[i]);
- hdst = hash_add(hdst, ((uint32_t *) &key->dst)[i]);
- }
+ hsrc = ct_endpoint_hash_add(hsrc, &key->src);
+ hdst = ct_endpoint_hash_add(hdst, &key->dst);
/* Even if source and destination are swapped the hash will be the same. */
hash = hsrc ^ hdst;
@@ -1546,7 +1542,7 @@ conn_key_hash(const struct conn_key *key, uint32_t basis)
(uint32_t *) (key + 1) - (uint32_t *) (&key->dst + 1),
hash);
- return hash;
+ return hash_finish(hash, 0);
}
static void