Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 28 Aug 2015 16:09:29 +0000 (UTC)
From:      Hans Petter Selasky <hselasky@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject:   svn commit: r287261 - projects/hps_head/sys/netinet
Message-ID:  <201508281609.t7SG9TIv054490@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: hselasky
Date: Fri Aug 28 16:09:29 2015
New Revision: 287261
URL: https://svnweb.freebsd.org/changeset/base/287261

Log:
  Checking the return value of callout_stop() is not enough to decide if
  a previous callout is still pending for completion or not. Use
  callout_drain_async() to do this instead.

Modified:
  projects/hps_head/sys/netinet/tcp_timer.c

Modified: projects/hps_head/sys/netinet/tcp_timer.c
==============================================================================
--- projects/hps_head/sys/netinet/tcp_timer.c	Fri Aug 28 15:41:09 2015	(r287260)
+++ projects/hps_head/sys/netinet/tcp_timer.c	Fri Aug 28 16:09:29 2015	(r287261)
@@ -934,7 +934,7 @@ tcp_timer_stop(struct tcpcb *tp, uint32_
 		}
 
 	if (tp->t_timers->tt_flags & timer_type) {
-		if (callout_stop(t_callout) &&
+		if (callout_drain_async(t_callout, f_callout, tp) == 0 &&
 		    (tp->t_timers->tt_flags & f_reset)) {
 			tp->t_timers->tt_flags &= ~(timer_type | f_reset);
 		} else {
@@ -948,7 +948,6 @@ tcp_timer_stop(struct tcpcb *tp, uint32_
 			 * classical check for callout reset/stop events:
 			 * callout_pending() || !callout_active()
 			 */
-			callout_reset(t_callout, 1, f_callout, tp);
 		}
 	}
 }



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201508281609.t7SG9TIv054490>