cvs commit: src/sys/netinet tcp_syncache.c

Mike Silbersack silby at silby.com
Tue Nov 11 10:04:34 PST 2003


On Tue, 11 Nov 2003, Sam Leffler wrote:

> sam         2003/11/11 09:54:47 PST
>
>   FreeBSD src repository
>
>   Modified files:
>     sys/netinet          tcp_syncache.c
>   Log:
>   o add missing inpcb locking in tcp_respond
>   o replace spl's with lock assertions
>
>   Supported by:   FreeBSD Foundation

Part of this looks goofy to me:

@@ -377,14 +374,12 @@ syncache_timer(xslot)
 	intptr_t slot = (intptr_t)xslot;
 	struct syncache *sc, *nsc;
 	struct inpcb *inp;
-	int s;

-	s = splnet();
 	INP_INFO_WLOCK(&tcbinfo);
         if (callout_pending(&tcp_syncache.tt_timerq[slot]) ||
             !callout_active(&tcp_syncache.tt_timerq[slot])) {
-		INP_INFO_WUNLOCK(&tcbinfo);
-                splx(s);
+		/* XXX can this happen? */
+		INP_INFO_WLOCK(&tcbinfo);
                 return;
         }
         callout_deactivate(&tcp_syncache.tt_timerq[slot]);
@@ -421,8 +416,7 @@ syncache_timer(xslot)
 	if (nsc != NULL)
 		callout_reset(&tcp_syncache.tt_timerq[slot],
 		    nsc->sc_rxttime - ticks, syncache_timer, (void
*)(slot));
-	INP_INFO_WUNLOCK(&tcbinfo);
-	splx(s);
+	INP_INFO_WLOCK(&tcbinfo);
 }

Shouldn't those WUNLOCK calls stay as WUNLOCK?

Mike "Silby" Silbersack


More information about the cvs-src mailing list