forked from Lainports/opnsense-ports
39 lines
1.5 KiB
Text
39 lines
1.5 KiB
Text
commit edbe55cb9057
|
|
Author: Randell Jesup <rjesup@jesup.org>
|
|
Date: Thu Dec 7 13:24:46 2017 -0500
|
|
|
|
Bug 1421963: lock around SCTP input processing, not just the receive callback r=drno
|
|
---
|
|
netwerk/sctp/datachannel/DataChannel.cpp | 5 +++--
|
|
1 file changed, 3 insertions(+), 2 deletions(-)
|
|
|
|
diff --git netwerk/sctp/datachannel/DataChannel.cpp netwerk/sctp/datachannel/DataChannel.cpp
|
|
index 4a0432469a80..6f13826ed7c6 100644
|
|
--- netwerk/sctp/datachannel/DataChannel.cpp
|
|
+++ netwerk/sctp/datachannel/DataChannel.cpp
|
|
@@ -817,6 +817,7 @@ DataChannelConnection::SctpDtlsInput(TransportFlow *flow,
|
|
}
|
|
}
|
|
// Pass the data to SCTP
|
|
+ MutexAutoLock lock(mLock);
|
|
usrsctp_conninput(static_cast<void *>(this), data, len, 0);
|
|
}
|
|
|
|
@@ -1224,7 +1225,7 @@ DataChannelConnection::SendDeferredMessages()
|
|
RefPtr<DataChannel> channel; // we may null out the refs to this
|
|
|
|
// This may block while something is modifying channels, but should not block for IO
|
|
- MutexAutoLock lock(mLock);
|
|
+ mLock.AssertCurrentThreadOwns();
|
|
|
|
LOG(("SendDeferredMessages called, pending type: %d", mPendingType));
|
|
if (!mPendingType) {
|
|
@@ -2307,7 +2308,7 @@ DataChannelConnection::ReceiveCallback(struct socket* sock, void *data, size_t d
|
|
if (!data) {
|
|
usrsctp_close(sock); // SCTP has finished shutting down
|
|
} else {
|
|
- MutexAutoLock lock(mLock);
|
|
+ mLock.AssertCurrentThreadOwns();
|
|
if (flags & MSG_NOTIFICATION) {
|
|
HandleNotification(static_cast<union sctp_notification *>(data), datalen);
|
|
} else {
|