svn commit: r354424 - stable/12/sys/netgraph
Gleb Smirnoff
glebius at FreeBSD.org
Thu Nov 7 00:28:50 UTC 2019
Author: glebius
Date: Thu Nov 7 00:28:50 2019
New Revision: 354424
URL: https://svnweb.freebsd.org/changeset/base/354424
Log:
Merge r353027:
Protect access to seq->xwin[] with the seq mutex.
Modified:
stable/12/sys/netgraph/ng_l2tp.c
Modified: stable/12/sys/netgraph/ng_l2tp.c
==============================================================================
--- stable/12/sys/netgraph/ng_l2tp.c Thu Nov 7 00:27:23 2019 (r354423)
+++ stable/12/sys/netgraph/ng_l2tp.c Thu Nov 7 00:28:50 2019 (r354424)
@@ -1462,6 +1462,7 @@ ng_l2tp_seq_rack_timeout(node_p node, hook_p hook, voi
/* 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, voi
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++);
More information about the svn-src-stable-12
mailing list