aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGleb Smirnoff <glebius@FreeBSD.org>2019-10-03 02:34:51 +0000
committerGleb Smirnoff <glebius@FreeBSD.org>2019-10-03 02:34:51 +0000
commit30b7addf5acdb9f73a38ea014ff1533c4cce91ff (patch)
treea199a7dc32d684afa9b0644775a5a1dacc769622
parent631cabba47716ccecae352bb2b4521a489b64bb2 (diff)
downloadsrc-30b7addf5acdb9f73a38ea014ff1533c4cce91ff.tar.gz
src-30b7addf5acdb9f73a38ea014ff1533c4cce91ff.zip
Protect access to seq->xwin[] with the seq mutex.
MFC after: 5 weeks
Notes
Notes: svn path=/head/; revision=353027
-rw-r--r--sys/netgraph/ng_l2tp.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/netgraph/ng_l2tp.c b/sys/netgraph/ng_l2tp.c
index 55fa2cd31060..91d998965d88 100644
--- a/sys/netgraph/ng_l2tp.c
+++ b/sys/netgraph/ng_l2tp.c
@@ -1462,6 +1462,7 @@ ng_l2tp_seq_rack_timeout(node_p node, hook_p hook, void *arg1, int arg2)
/* Sanity check */
L2TP_SEQ_CHECK(seq);
+ mtx_lock(&seq->mtx);
priv->stats.xmitRetransmits++;
/* Have we reached the retransmit limit? If so, notify owner. */
@@ -1482,7 +1483,9 @@ ng_l2tp_seq_rack_timeout(node_p node, hook_p hook, void *arg1, int arg2)
seq->acks = 0;
/* Retransmit oldest unack'd packet */
- if ((m = L2TP_COPY_MBUF(seq->xwin[0], M_NOWAIT)) == NULL)
+ m = L2TP_COPY_MBUF(seq->xwin[0], M_NOWAIT);
+ mtx_unlock(&seq->mtx);
+ if (m == NULL)
priv->stats.memoryFailures++;
else
ng_l2tp_xmit_ctrl(priv, m, seq->ns++);