From 627dfd6df9892815d6dc1144d53fd522e42f4bfa Mon Sep 17 00:00:00 2001 From: Michael Tuexen Date: Tue, 18 Aug 2009 19:58:49 +0000 Subject: [PATCH] Fix a crash when using one-to-one stlye socket in non-blocking mode and there is no listening server. PR: 137795 Approved by: re, rrs (mentor) MFC after:immediately. --- sys/netinet/sctp_output.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/netinet/sctp_output.c b/sys/netinet/sctp_output.c index 5cde4d0dd69..1e768fc5bbe 100644 --- a/sys/netinet/sctp_output.c +++ b/sys/netinet/sctp_output.c @@ -12464,7 +12464,8 @@ sctp_lower_sosend(struct socket *so, error = ENOTCONN; goto out_unlocked; } - hold_tcblock = 0; + SCTP_TCB_LOCK(stcb); + hold_tcblock = 1; SCTP_INP_RUNLOCK(inp); if (addr) { /* Must locate the net structure if addr given */