Browse Source

Merge pull request #342 from paullouisageneau/fix-usrsctp-data-race

Update usrsctp and mitigate possible data race
Paul-Louis Ageneau 4 years ago
parent
commit
011bfbe46f
2 changed files with 5 additions and 1 deletions
  1. 1 1
      deps/usrsctp
  2. 4 0
      src/sctptransport.cpp

+ 1 - 1
deps/usrsctp

@@ -1 +1 @@
-Subproject commit 2e754d58227f76b8d8c7358ee5f5770b78cc239a
+Subproject commit 07f871bda23943c43c9e74cc54f25130459de830

+ 4 - 0
src/sctptransport.cpp

@@ -349,6 +349,10 @@ void SctpTransport::incoming(message_ptr message) {
 	}
 
 	PLOG_VERBOSE << "Incoming size=" << message->size();
+
+	// TODO: There seems to be a possible data race between usrsctp_sendv() and usrsctp_conninput()
+	// As a mitigation, lock the send mutex before calling usrsctp_conninput()
+	std::lock_guard lock(mSendMutex);
 	usrsctp_conninput(this, message->data(), message->size(), 0);
 }