From e5f3d4af3156f7b07a1a35e75cd537e6d0ff9902 Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Fri, 8 Jun 2007 02:45:30 +0000 Subject: [PATCH] Better hash function for file handles, as suggested by Brent Callaghan (the old one was mapping file handles that differed only by one bit to the same hash value; the new one mapped them to different hash values). svn path=/trunk/; revision=22065 --- epan/dissectors/packet-nfs.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/epan/dissectors/packet-nfs.c b/epan/dissectors/packet-nfs.c index 09c4a03fae..3bdd2f4c8e 100644 --- a/epan/dissectors/packet-nfs.c +++ b/epan/dissectors/packet-nfs.c @@ -1840,8 +1840,7 @@ dissect_fhandle_data(tvbuff_t *tvb, int offset, packet_info *pinfo, for(fhhash=0,i=0;i<(fhlen-3);i+=4){ guint32 val; val = tvb_get_ntohl(tvb, offset+i); - fhhash ^= val; - fhhash += val; + fhhash ^= (val >> 16) ^ val; } if(hidden){ fh_item=proto_tree_add_uint_hidden(tree, hf_nfs_fh_hash, tvb, offset,