Date: Tue, 30 Jun 2009 15:23:16 +0000 (UTC) From: Attilio Rao <attilio@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org Subject: svn commit: r195196 - stable/6/sys/netinet Message-ID: <200906301523.n5UFNGmN084562@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: attilio Date: Tue Jun 30 15:23:16 2009 New Revision: 195196 URL: http://svn.freebsd.org/changeset/base/195196 Log: If the table is empty we can end up with a NULL pointer. Handle that case trying to free and re-allocate a new object for the timerqueue, managing unallocations. This is not an issue on 7 and further branches. Submitted by: emaste Sponsored by: Sandvine Incorporated Reported by: Kyle Larose <no e-mail available> Modified: stable/6/sys/netinet/tcp_syncache.c Modified: stable/6/sys/netinet/tcp_syncache.c ============================================================================== --- stable/6/sys/netinet/tcp_syncache.c Tue Jun 30 14:34:06 2009 (r195195) +++ stable/6/sys/netinet/tcp_syncache.c Tue Jun 30 15:23:16 2009 (r195196) @@ -891,13 +891,15 @@ syncache_add(inc, to, th, sop, m) /* NB: guarded by INP_INFO_WLOCK(&tcbinfo) */ for (i = SYNCACHE_MAXREXMTS; i >= 0; i--) { sc = TAILQ_FIRST(&tcp_syncache.timerq[i]); - if (sc != NULL) + if (sc != NULL) { + sc->sc_tp->ts_recent = ticks; + syncache_drop(sc, NULL); + tcpstat.tcps_sc_zonefail++; + sc = uma_zalloc(tcp_syncache.zone, M_NOWAIT | + M_ZERO); break; + } } - sc->sc_tp->ts_recent = ticks; - syncache_drop(sc, NULL); - tcpstat.tcps_sc_zonefail++; - sc = uma_zalloc(tcp_syncache.zone, M_NOWAIT | M_ZERO); if (sc == NULL) { if (ipopts) (void) m_free(ipopts);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200906301523.n5UFNGmN084562>