svn commit: r287261 - projects/hps_head/sys/netinet

Hans Petter Selasky hselasky at FreeBSD.org
Fri Aug 28 16:09:30 UTC 2015


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);
 		}
 	}
 }


More information about the svn-src-projects mailing list