summaryrefslogtreecommitdiff
path: root/sys/netinet/tcp_hostcache.c
diff options
context:
space:
mode:
authorAndre Oppermann <andre@FreeBSD.org>2007-06-07 21:41:50 +0000
committerAndre Oppermann <andre@FreeBSD.org>2007-06-07 21:41:50 +0000
commit45024be06fc14a0461e4ece72566f05166be8b17 (patch)
treeb1cc9a6c83324c4b2db6051ef7142d36b517ef0e /sys/netinet/tcp_hostcache.c
parenta66fde8d35931c0e32ac294a1a2c1bf6b877425f (diff)
Notes
Diffstat (limited to 'sys/netinet/tcp_hostcache.c')
-rw-r--r--sys/netinet/tcp_hostcache.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/sys/netinet/tcp_hostcache.c b/sys/netinet/tcp_hostcache.c
index 770723798176..e3350009abb8 100644
--- a/sys/netinet/tcp_hostcache.c
+++ b/sys/netinet/tcp_hostcache.c
@@ -351,7 +351,13 @@ tcp_hc_insert(struct in_conninfo *inc)
* efficient. Instead just reuse the least used element.
* We may drop something that is still "in-use" but we can be
* "lossy".
+ * Just give up if this bucket row is empty and we don't have
+ * anything to replace.
*/
+ if (hc_entry == NULL) {
+ THC_UNLOCK(&hc_head->hch_mtx);
+ return NULL;
+ }
TAILQ_REMOVE(&hc_head->hch_bucket, hc_entry, rmx_q);
tcp_hostcache.hashbase[hash].hch_length--;
tcp_hostcache.cache_count--;