]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
STABLE14-viced-improve-host-hashing-20090315
authorMike Meffie <mmeffie@sinenomine.net>
Sun, 15 Mar 2009 18:31:03 +0000 (18:31 +0000)
committerDerrick Brashear <shadow@dementia.org>
Sun, 15 Mar 2009 18:31:03 +0000 (18:31 +0000)
LICENSE IPL10
FIXES 124447

hash based on host byte order so intel machines aren't sad

(cherry picked from commit 5102d56f080f1284eecb94dbc7c06cb966c27f5b)

src/viced/host.c

index 5f473e1516c5b4f79c2463655b989737706105f6..b3472e52db95f0c61c57302755ce2cebbc79ef17 100644 (file)
@@ -180,7 +180,7 @@ static struct host *HTFree = 0;     /* first free file entry */
  */
 static struct h_AddrHashChain *hostAddrHashTable[h_HASHENTRIES];
 static struct h_UuidHashChain *hostUuidHashTable[h_HASHENTRIES];
-#define h_HashIndex(hostip) ((hostip) & (h_HASHENTRIES-1))
+#define h_HashIndex(hostip) (ntohl(hostip) & (h_HASHENTRIES-1))
 #define h_UuidHashIndex(uuidp) (((int)(afs_uuid_hash(uuidp))) & (h_HASHENTRIES-1))
 
 struct HTBlock {               /* block of HTSPERBLOCK file entries */