Back out last change to inpcb_free. Turns out we need

to hold off freeing if there is data pending ... someone
might do send/close. Which means we want the data to
go and then close it after startup. Added comments to
the code as well to note that this is done for a reason.
This commit is contained in:
Randall Stewart 2007-06-17 19:27:46 +00:00
parent 838d35891f
commit 75298de2a0
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=170894

View File

@ -2559,9 +2559,20 @@ sctp_inpcb_free(struct sctp_inpcb *inp, int immediate, int from)
}
if ((SCTP_GET_STATE(&asoc->asoc) == SCTP_STATE_COOKIE_WAIT) ||
(SCTP_GET_STATE(&asoc->asoc) == SCTP_STATE_COOKIE_ECHOED)) {
/* Just abandon things in the front states */
sctp_free_assoc(inp, asoc, SCTP_PCBFREE_NOFORCE, SCTP_FROM_SCTP_PCB + SCTP_LOC_2);
continue;
/*
* If we have data in queue, we don't want
* to just free since the app may have done,
* send()/close or connect/send/close. And
* it wants the data to get across first.
*/
if (asoc->asoc.total_output_queue_size == 0) {
/*
* Just abandon things in the front
* states
*/
sctp_free_assoc(inp, asoc, SCTP_PCBFREE_NOFORCE, SCTP_FROM_SCTP_PCB + SCTP_LOC_2);
continue;
}
}
SCTP_TCB_LOCK(asoc);
/* Disconnect the socket please */