From b636369bf937eb31836b021fdf11eae93603cfdc Mon Sep 17 00:00:00 2001 From: Michael Tuexen Date: Mon, 28 Mar 2016 22:17:58 +0200 Subject: [PATCH 1/4] Try to fix https://github.com/sctplab/usrsctp/tree/Issue66. --- usrsctplib/netinet/sctp_usrreq.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usrsctplib/netinet/sctp_usrreq.c b/usrsctplib/netinet/sctp_usrreq.c index 33a7584c8..f55cbe23b 100755 --- a/usrsctplib/netinet/sctp_usrreq.c +++ b/usrsctplib/netinet/sctp_usrreq.c @@ -90,9 +90,9 @@ sctp_init(void) sctp_init_sysctls(); #if defined(__Userspace__) #if defined(__Userspace_os_Windows) || defined(__Userspace_os_NaCl) - srand((unsigned int)time(NULL)); + srandom((unsigned int)GetCurrentProcessId() | (unsigned int)time(NULL)); #else - srandom(getpid()); /* so inp->sctp_ep.random_numbers are truly random... */ + srandom((unsigned int)getpid() | (unsigned int)time(NULL)); #endif #endif #if defined(__Panda__) From 5027211e087fd3081592ca3fc6af2a1ab3eb4c94 Mon Sep 17 00:00:00 2001 From: Michael Tuexen Date: Mon, 28 Mar 2016 22:22:49 +0200 Subject: [PATCH 2/4] Use XOR. --- usrsctplib/netinet/sctp_usrreq.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usrsctplib/netinet/sctp_usrreq.c b/usrsctplib/netinet/sctp_usrreq.c index f55cbe23b..9b4c83599 100755 --- a/usrsctplib/netinet/sctp_usrreq.c +++ b/usrsctplib/netinet/sctp_usrreq.c @@ -90,9 +90,9 @@ sctp_init(void) sctp_init_sysctls(); #if defined(__Userspace__) #if defined(__Userspace_os_Windows) || defined(__Userspace_os_NaCl) - srandom((unsigned int)GetCurrentProcessId() | (unsigned int)time(NULL)); + srandom((unsigned int)GetCurrentProcessId() ^ (unsigned int)time(NULL)); #else - srandom((unsigned int)getpid() | (unsigned int)time(NULL)); + srandom((unsigned int)getpid() ^ (unsigned int)time(NULL)); #endif #endif #if defined(__Panda__) From 162f52d83a2388b62039edead352714feea041e1 Mon Sep 17 00:00:00 2001 From: Michael Tuexen Date: Fri, 1 Apr 2016 22:01:27 -0300 Subject: [PATCH 3/4] Sync with stream reset improved. --- usrsctplib/netinet/sctp_output.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/usrsctplib/netinet/sctp_output.c b/usrsctplib/netinet/sctp_output.c index 540e2d2c4..db0c14e71 100755 --- a/usrsctplib/netinet/sctp_output.c +++ b/usrsctplib/netinet/sctp_output.c @@ -32,7 +32,7 @@ #ifdef __FreeBSD__ #include -__FBSDID("$FreeBSD: head/sys/netinet/sctp_output.c 297312 2016-03-27 10:04:25Z tuexen $"); +__FBSDID("$FreeBSD: head/sys/netinet/sctp_output.c 297497 2016-04-01 20:38:15Z tuexen $"); #endif #include @@ -9410,6 +9410,8 @@ sctp_queue_op_err(struct sctp_tcb *stcb, struct mbuf *op_err) chk->asoc = &stcb->asoc; chk->data = op_err; chk->whoTo = NULL; + chk->rec.chunk_id.id = SCTP_OPERATION_ERROR; + chk->rec.chunk_id.can_take_data = 0; hdr = mtod(op_err, struct sctp_chunkhdr *); hdr->chunk_type = SCTP_OPERATION_ERROR; hdr->chunk_flags = 0; From d553a031966e855f068b9dd8aceb5c66518fb4d4 Mon Sep 17 00:00:00 2001 From: Michael Tuexen Date: Fri, 8 Apr 2016 11:10:11 -0300 Subject: [PATCH 4/4] Increase version. --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index f3375cc46..efe2c31d6 100644 --- a/configure.ac +++ b/configure.ac @@ -28,7 +28,7 @@ dnl OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF dnl SUCH DAMAGE. dnl -AC_INIT([libusrsctp], [0.9.2.1]) +AC_INIT([libusrsctp], [0.9.3.0]) AM_INIT_AUTOMAKE AC_PROG_CC