Author: markj
Date: Mon Sep 28 12:14:38 2020
New Revision: 366223
URL: https://svnweb.freebsd.org/changeset/base/366223

Log:
  MFS r366220:
  MFC r366167:
  ng_l2tp: Fix callout synchronization in the rexmit timeout handler
  
  PR:           241133
  Approved by:  re (gjb)

Modified:
  releng/12.2/sys/netgraph/ng_l2tp.c
Directory Properties:
  releng/12.2/   (props changed)

Modified: releng/12.2/sys/netgraph/ng_l2tp.c
==============================================================================
--- releng/12.2/sys/netgraph/ng_l2tp.c  Mon Sep 28 11:52:09 2020        
(r366222)
+++ releng/12.2/sys/netgraph/ng_l2tp.c  Mon Sep 28 12:14:38 2020        
(r366223)
@@ -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. */
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "[email protected]"

Reply via email to