diff options
author | andre <andre@FreeBSD.org> | 2007-04-17 15:25:14 +0000 |
---|---|---|
committer | andre <andre@FreeBSD.org> | 2007-04-17 15:25:14 +0000 |
commit | 2573926e35dd20e2665d064b7acea13689ba8130 (patch) | |
tree | 68a36d7cba1225fe3110016b5a790e1004163cd2 /sys/netinet/tcp_syncache.c | |
parent | 99ac3651bd2fa42498b0ae9eec88e89aae117757 (diff) | |
download | FreeBSD-src-2573926e35dd20e2665d064b7acea13689ba8130.zip FreeBSD-src-2573926e35dd20e2665d064b7acea13689ba8130.tar.gz |
When we run into the syncache entry limits syncache_add() tries
to free the oldest entry in the current bucket row. The global
entry limit may be smaller than the bucket rows and their limit
combined however. Thus only try to free a syncache entry if we
found one in this bucket row.
Reported by: kris
Diffstat (limited to 'sys/netinet/tcp_syncache.c')
-rw-r--r-- | sys/netinet/tcp_syncache.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/netinet/tcp_syncache.c b/sys/netinet/tcp_syncache.c index 128057b..4e41134 100644 --- a/sys/netinet/tcp_syncache.c +++ b/sys/netinet/tcp_syncache.c @@ -960,8 +960,8 @@ syncache_add(struct in_conninfo *inc, struct tcpopt *to, struct tcphdr *th, * entry and insert the new one. */ tcpstat.tcps_sc_zonefail++; - sc = TAILQ_LAST(&sch->sch_bucket, sch_head); - syncache_drop(sc, sch); + if ((sc = TAILQ_LAST(&sch->sch_bucket, sch_head)) != NULL) + syncache_drop(sc, sch); sc = uma_zalloc(tcp_syncache.zone, M_NOWAIT | M_ZERO); if (sc == NULL) { if (tcp_syncookies) { |