aboutsummaryrefslogtreecommitdiff
path: root/crypto
diff options
context:
space:
mode:
authorNeilBrown <neilb@cse.unsw.edu.au>2006-01-06 00:09:49 -0800
committerLinus Torvalds <torvalds@g5.osdl.org>2006-01-06 08:33:21 -0800
commit1f1e030bf75774b6a283518e1534d598e14147d4 (patch)
tree8b59e6ed6db756066d2cc18b35d00a753f13e237 /crypto
parent4b2f0260c74324abca76ccaa42d426af163125e7 (diff)
[PATCH] knfsd: fix hash function for IP addresses on 64bit little-endian machines.
The hash.h hash_long function, when used on a 64 bit machine, ignores many of the middle-order bits. (The prime chosen it too bit-sparse). IP addresses for clients of an NFS server are very likely to differ only in the low-order bits. As addresses are stored in network-byte-order, these bits become middle-order bits in a little-endian 64bit 'long', and so do not contribute to the hash. Thus you can have the situation where all clients appear on one hash chain. So, until hash_long is fixed (or maybe forever), us a hash function that works well on IP addresses - xor the bytes together. Thanks to "Iozone" <capps@iozone.org> for identifying this problem. Cc: "Iozone" <capps@iozone.org> Signed-off-by: Neil Brown <neilb@suse.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'crypto')
0 files changed, 0 insertions, 0 deletions