diff options
author | andre <andre@FreeBSD.org> | 2003-11-28 16:33:03 +0000 |
---|---|---|
committer | andre <andre@FreeBSD.org> | 2003-11-28 16:33:03 +0000 |
commit | c06e5a954d0823e6eb2685d8b4d9072568909bcd (patch) | |
tree | b89ea3dd35cea001eee9869a0e778d81276358a4 /sys/netinet/tcp_hostcache.c | |
parent | 547eb2ea6db3e6e5b6733ff2e160bbbd14c287bd (diff) | |
download | FreeBSD-src-c06e5a954d0823e6eb2685d8b4d9072568909bcd.zip FreeBSD-src-c06e5a954d0823e6eb2685d8b4d9072568909bcd.tar.gz |
Fix an optimization where I made an ifdef'd out section to broad.
When the hostcache bucket limit is reached the last bucket wasn't
removed from the bucket row but inserted a few lines later at the
bucket row head again. This leads to infinite loop when the same
bucket row is accessed the next time for a lookup/insert or purge
action.
Tested by: imp, Matt Smith
Approved by: re (rwatson)
Diffstat (limited to 'sys/netinet/tcp_hostcache.c')
-rw-r--r-- | sys/netinet/tcp_hostcache.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/netinet/tcp_hostcache.c b/sys/netinet/tcp_hostcache.c index 461ce85..52f573f 100644 --- a/sys/netinet/tcp_hostcache.c +++ b/sys/netinet/tcp_hostcache.c @@ -351,16 +351,16 @@ tcp_hc_insert(struct in_conninfo *inc) * At first we were dropping the last element, just to * reaquire it in the next two lines again which ain't * very efficient. Instead just reuse the least used element. - * maybe we drop something that is still "in-use" but we can + * Maybe we drop something that is still "in-use" but we can * be "lossy". */ -#if 0 TAILQ_REMOVE(&hc_head->hch_bucket, hc_entry, rmx_q); - uma_zfree(tcp_hostcache.zone, hc_entry); tcp_hostcache.hashbase[hash].hch_length--; tcp_hostcache.cache_count--; -#endif tcpstat.tcps_hc_bucketoverflow++; +#if 0 + uma_zfree(tcp_hostcache.zone, hc_entry); +#endif } else { /* * Allocate a new entry, or balk if not possible |