aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Johnston <markj@FreeBSD.org>2020-09-28 12:14:38 +0000
committerMark Johnston <markj@FreeBSD.org>2020-09-28 12:14:38 +0000
commit006fd7bf6ea3657d0197fd2d959e3a72fd81ca0f (patch)
tree14215e4e6ad0be9107cbb726dec745db99e22a1e
parent5c0363ec1a263bdfa2ea6ce3ae744a6eec546636 (diff)
downloadsrc-006fd7bf6ea3657d0197fd2d959e3a72fd81ca0f.tar.gz
src-006fd7bf6ea3657d0197fd2d959e3a72fd81ca0f.zip
MFS r366220:
MFC r366167: ng_l2tp: Fix callout synchronization in the rexmit timeout handler PR: 241133 Approved by: re (gjb)
Notes
Notes: svn path=/releng/12.2/; revision=366223
-rw-r--r--sys/netgraph/ng_l2tp.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/sys/netgraph/ng_l2tp.c b/sys/netgraph/ng_l2tp.c
index 91d998965d88..a44407511d92 100644
--- a/sys/netgraph/ng_l2tp.c
+++ b/sys/netgraph/ng_l2tp.c
@@ -1454,15 +1454,17 @@ ng_l2tp_seq_rack_timeout(node_p node, hook_p hook, void *arg1, int arg2)
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. */