Fix for 5.2-BETA lockup problems

From: Andre Oppermann <andre_at_freebsd.org>
Date: Thu, 27 Nov 2003 23:48:14 +0100
Hello all,

I've found what probably is going wrong in tcp_hostcache.  The problem is me
cutting corners (what goes around comes around...) in tcp_hc_insert when the
bucket limit is reached.  I made the #if 0 too big and the bucket was not
removed from the tailqueue when we hit the bucket limit.  A couple of lines
later it is inserted again as head element which leads to an infinite loop
either when the next lookup on the same bucket row is done, or when the
the tcp_hc_purge function is run to timeout the entries.

Please try the attached patch which should fix it.

-- 
Andre


Index: tcp_hostcache.c
===================================================================
RCS file: /home/ncvs/src/sys/netinet/tcp_hostcache.c,v
retrieving revision 1.1
diff -u -p -r1.1 tcp_hostcache.c
--- tcp_hostcache.c     20 Nov 2003 20:07:38 -0000      1.1
+++ tcp_hostcache.c     27 Nov 2003 20:23:06 -0000
_at__at_ -354,11 +354,11 _at__at_ tcp_hc_insert(struct in_conninfo *inc)
                 * 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--;
+#if 0
+               uma_zfree(tcp_hostcache.zone, hc_entry);
 #endif
                tcpstat.tcps_hc_bucketoverflow++;
        } else {
Received on Thu Nov 27 2003 - 13:48:17 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:37:31 UTC