Author: tuexen
Date: Thu May 16 09:16:47 2019
New Revision: 347671
URL: https://svnweb.freebsd.org/changeset/base/347671

Log:
  MFC r344925:
  
  Fix locking bug.

Modified:
  stable/11/sys/netinet/sctp_usrreq.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/netinet/sctp_usrreq.c
==============================================================================
--- stable/11/sys/netinet/sctp_usrreq.c Thu May 16 09:15:18 2019        
(r347670)
+++ stable/11/sys/netinet/sctp_usrreq.c Thu May 16 09:16:47 2019        
(r347671)
@@ -4069,10 +4069,12 @@ sctp_setopt(struct socket *so, int optname, void *optv
                        }
                        SCTP_FIND_STCB(inp, stcb, av->assoc_id);
                        if (stcb) {
+                               SCTP_TCB_SEND_LOCK(stcb);
                                stcb->asoc.ss_functions.sctp_ss_clear(stcb, 
&stcb->asoc, 1, 1);
                                stcb->asoc.ss_functions = 
sctp_ss_functions[av->assoc_value];
                                stcb->asoc.stream_scheduling_module = 
av->assoc_value;
                                stcb->asoc.ss_functions.sctp_ss_init(stcb, 
&stcb->asoc, 1);
+                               SCTP_TCB_SEND_UNLOCK(stcb);
                                SCTP_TCB_UNLOCK(stcb);
                        } else {
                                if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) 
||
@@ -4088,10 +4090,12 @@ sctp_setopt(struct socket *so, int optname, void *optv
                                        SCTP_INP_RLOCK(inp);
                                        LIST_FOREACH(stcb, 
&inp->sctp_asoc_list, sctp_tcblist) {
                                                SCTP_TCB_LOCK(stcb);
+                                               SCTP_TCB_SEND_LOCK(stcb);
                                                
stcb->asoc.ss_functions.sctp_ss_clear(stcb, &stcb->asoc, 1, 1);
                                                stcb->asoc.ss_functions = 
sctp_ss_functions[av->assoc_value];
                                                
stcb->asoc.stream_scheduling_module = av->assoc_value;
                                                
stcb->asoc.ss_functions.sctp_ss_init(stcb, &stcb->asoc, 1);
+                                               SCTP_TCB_SEND_UNLOCK(stcb);
                                                SCTP_TCB_UNLOCK(stcb);
                                        }
                                        SCTP_INP_RUNLOCK(inp);
_______________________________________________
[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