summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Hellstrom <thellstrom-at-vmware-dot-com>2009-02-25 14:23:56 +0100
committerThomas Hellstrom <thellstrom-at-vmware-dot-com>2009-02-25 14:25:35 +0100
commitb9acb270011d3d69688bbc2f15aa09c58ede67c5 (patch)
tree4691b0523271b6e1a04431c8755631fb061b63b1
parentee31a213bb926f24f91f51fe170bceb990d9c585 (diff)
Use the buffer pointer as a hash key. Not the address of the local variable holding the buffer pointer.
-rw-r--r--src/wsbm_manager.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/wsbm_manager.c b/src/wsbm_manager.c
index 2d53dbe..e40571d 100644
--- a/src/wsbm_manager.c
+++ b/src/wsbm_manager.c
@@ -926,13 +926,16 @@ wsbmAddValidateItem(struct _ValidateList *list, void *buf, uint64_t flags,
struct _WsbmListHead *l;
struct _WsbmListHead *hashHead;
uint32_t hash;
+ uint32_t count = 0;
+ uint32_t key = (unsigned long) buf;
cur = NULL;
- hash = wsbmHashFunc((uint8_t *) buf, (sizeof(buf)), list->hashMask);
+ hash = wsbmHashFunc((uint8_t *) &key, 4, list->hashMask);
hashHead = list->hashTable + hash;
*newItem = 0;
for (l = hashHead->next; l != hashHead; l = l->next) {
+ count++;
node = WSBMLISTENTRY(l, struct _ValidateNode, hashHead);
if (node->buf == buf) {
@@ -940,6 +943,7 @@ wsbmAddValidateItem(struct _ValidateList *list, void *buf, uint64_t flags,
break;
}
}
+
if (!cur) {
cur = validateListAddNode(list, buf, hash, flags, mask);
if (!cur)