Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 28 Sep 2020 11:48:20 +0000 (UTC)
From:      Mark Johnston <markj@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject:   svn commit: r366221 - stable/11/sys/netgraph
Message-ID:  <202009281148.08SBmKFv051644@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: markj
Date: Mon Sep 28 11:48:20 2020
New Revision: 366221
URL: https://svnweb.freebsd.org/changeset/base/366221

Log:
  MFC r366167:
  ng_l2tp: Fix callout synchronization in the rexmit timeout handler
  
  PR:	241133

Modified:
  stable/11/sys/netgraph/ng_l2tp.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/netgraph/ng_l2tp.c
==============================================================================
--- stable/11/sys/netgraph/ng_l2tp.c	Mon Sep 28 11:46:03 2020	(r366220)
+++ stable/11/sys/netgraph/ng_l2tp.c	Mon Sep 28 11:48:20 2020	(r366221)
@@ -1454,15 +1454,17 @@ ng_l2tp_seq_rack_timeout(node_p node, hook_p hook, voi
 	struct mbuf *m;
 	u_int delay;
 
-	/* Make sure callout is still active before doing anything */
-	if (callout_pending(&seq->rack_timer) ||
-	    (!callout_active(&seq->rack_timer)))
-		return;
-
 	/* Sanity check */
 	L2TP_SEQ_CHECK(seq);
 
 	mtx_lock(&seq->mtx);
+	/* Make sure callout is still active before doing anything */
+	if (callout_pending(&seq->rack_timer) ||
+	    !callout_active(&seq->rack_timer)) {
+		mtx_unlock(&seq->mtx);
+		return;
+	}
+
 	priv->stats.xmitRetransmits++;
 
 	/* Have we reached the retransmit limit? If so, notify owner. */



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