From: Anders Kaseorg Date: Fri, 16 Dec 2016 07:43:48 +0000 (-0500) Subject: opr: Make opr_uuid_hash endian-independent X-Git-Tag: upstream/1.8.0_pre2^3~75 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=9ec765d8b4a327ae36c26e38a84dae215d3a2664;p=packages%2Fo%2Fopenafs.git opr: Make opr_uuid_hash endian-independent And also make sure it doesn’t use unaligned accesses. Fixes a ‘make check’ failure on big-endian architectures. Change-Id: I490174f8d1eecb5f20969b4ef12ff16d0dd3806a Reviewed-on: https://gerrit.openafs.org/12495 Tested-by: BuildBot Reviewed-by: Benjamin Kaduk Reviewed-by: Michael Meffie Tested-by: Michael Meffie --- diff --git a/src/opr/uuid.c b/src/opr/uuid.c index 493c660b2..6a22ca3c2 100644 --- a/src/opr/uuid.c +++ b/src/opr/uuid.c @@ -58,9 +58,7 @@ opr_uuid_equal(const opr_uuid_t *uuid1, const opr_uuid_t *uuid2) unsigned int opr_uuid_hash(const opr_uuid_t *uuid) { - /* uuid->data is a (unsigned char *), so there's every danger that this - * may cause an unaligned access on some platforms */ - return opr_jhash((const afs_uint32 *)uuid->data, 4, 0); + return opr_jhash_opaque(uuid->data, sizeof(uuid->data), 0); } #if !defined(KERNEL)