svn commit: r347108 - stable/12/sys/netinet
Michael Tuexen
tuexen at FreeBSD.org
Sat May 4 11:18:40 UTC 2019
Author: tuexen
Date: Sat May 4 11:18:39 2019
New Revision: 347108
URL: https://svnweb.freebsd.org/changeset/base/347108
Log:
MFC r344925:
Fix locking bug.
Modified:
stable/12/sys/netinet/sctp_usrreq.c
Directory Properties:
stable/12/ (props changed)
Modified: stable/12/sys/netinet/sctp_usrreq.c
==============================================================================
--- stable/12/sys/netinet/sctp_usrreq.c Sat May 4 11:17:20 2019 (r347107)
+++ stable/12/sys/netinet/sctp_usrreq.c Sat May 4 11:18:39 2019 (r347108)
@@ -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);
More information about the svn-src-stable-12
mailing list