X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=lib%2Fhash.c;h=8f34493b52b2693d2a623343ca7c70594f42fd5f;hb=003ce655b7116d18c86a74c50391e54990346931;hp=e954d786940616682ceeec840c537a11a9975b0a;hpb=c49d1dd1686277277cb742ec0fc93749214de391;p=sliver-openvswitch.git diff --git a/lib/hash.c b/lib/hash.c index e954d7869..8f34493b5 100644 --- a/lib/hash.c +++ b/lib/hash.c @@ -29,15 +29,15 @@ hash_3words(uint32_t a, uint32_t b, uint32_t c) uint32_t hash_bytes(const void *p_, size_t n, uint32_t basis) { - const uint8_t *p = p_; + const uint32_t *p = p_; size_t orig_n = n; uint32_t hash; hash = basis; while (n >= 4) { - hash = mhash_add(hash, get_unaligned_u32((const uint32_t *) p)); + hash = mhash_add(hash, get_unaligned_u32(p)); n -= 4; - p += 4; + p += 1; } if (n) {