From 9ec765d8b4a327ae36c26e38a84dae215d3a2664 Mon Sep 17 00:00:00 2001 From: Anders Kaseorg Date: Fri, 16 Dec 2016 02:43:48 -0500 Subject: [PATCH] opr: Make opr_uuid_hash endian-independent MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 --- src/opr/uuid.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/opr/uuid.c b/src/opr/uuid.c index 493c660..6a22ca3 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) -- 1.9.4