Commit a8fb1174 authored by Geoff Simmons's avatar Geoff Simmons

trackrdrd: ensure that open entries are found by hash_find()

parent e429f8f6
...@@ -554,17 +554,16 @@ static hashentry ...@@ -554,17 +554,16 @@ static hashentry
uint32_t h = h1(xid); uint32_t h = h1(xid);
he = &htbl.entry[INDEX(h)]; he = &htbl.entry[INDEX(h)];
if (he->xid == xid) if (he->xid == xid && he->state == HASH_OPEN)
return (he); return (he);
h = h2(xid); h = h2(xid);
unsigned n = 0; unsigned n = 0;
do { do {
he = &htbl.entry[INDEX(h)]; he = &htbl.entry[INDEX(h)];
probes++; if (he->xid == xid && he->state == HASH_OPEN)
if (he->xid == xid)
break; break;
probes++;
n++; n++;
h += n * n; h += n * n;
} while (probes <= htbl.max_probes); } while (probes <= htbl.max_probes);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment