diff options
| author | Michael Tuexen <tuexen@FreeBSD.org> | 2020-02-12 17:02:15 +0000 |
|---|---|---|
| committer | Michael Tuexen <tuexen@FreeBSD.org> | 2020-02-12 17:02:15 +0000 |
| commit | ca3de626ec4d47f38ea815a70498cb5ec7209ae0 (patch) | |
| tree | 637718e2edfc9d578cdd33652df975237e7332b0 /sys | |
| parent | 8e173ae7f494838227893430bda0c5c4ec8a312c (diff) | |
Notes
Diffstat (limited to 'sys')
| -rw-r--r-- | sys/netinet/sctp_pcb.c | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/sys/netinet/sctp_pcb.c b/sys/netinet/sctp_pcb.c index add79e8e9dc6..02eb470a566e 100644 --- a/sys/netinet/sctp_pcb.c +++ b/sys/netinet/sctp_pcb.c @@ -4744,6 +4744,31 @@ sctp_free_assoc(struct sctp_inpcb *inp, struct sctp_tcb *stcb, int from_inpcbfre else so = inp->sctp_socket; + if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || + (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL)) { + /* + * For TCP type we need special handling when we are + * connected. We also include the peel'ed off ones to. + */ + if (inp->sctp_flags & SCTP_PCB_FLAGS_CONNECTED) { + inp->sctp_flags &= ~SCTP_PCB_FLAGS_CONNECTED; + inp->sctp_flags |= SCTP_PCB_FLAGS_WAS_CONNECTED; + if (so) { + SOCKBUF_LOCK(&so->so_rcv); + so->so_state &= ~(SS_ISCONNECTING | + SS_ISDISCONNECTING | + SS_ISCONFIRMING | + SS_ISCONNECTED); + so->so_state |= SS_ISDISCONNECTED; + socantrcvmore_locked(so); + socantsendmore(so); + sctp_sowwakeup(inp, so); + sctp_sorwakeup(inp, so); + SCTP_SOWAKEUP(so); + } + } + } + /* * We used timer based freeing if a reader or writer is in the way. * So we first check if we are actually being called from a timer, @@ -4871,31 +4896,6 @@ sctp_free_assoc(struct sctp_inpcb *inp, struct sctp_tcb *stcb, int from_inpcbfre /* nothing around */ so = NULL; - if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || - (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL)) { - /* - * For TCP type we need special handling when we are - * connected. We also include the peel'ed off ones to. - */ - if (inp->sctp_flags & SCTP_PCB_FLAGS_CONNECTED) { - inp->sctp_flags &= ~SCTP_PCB_FLAGS_CONNECTED; - inp->sctp_flags |= SCTP_PCB_FLAGS_WAS_CONNECTED; - if (so) { - SOCKBUF_LOCK(&so->so_rcv); - so->so_state &= ~(SS_ISCONNECTING | - SS_ISDISCONNECTING | - SS_ISCONFIRMING | - SS_ISCONNECTED); - so->so_state |= SS_ISDISCONNECTED; - socantrcvmore_locked(so); - socantsendmore(so); - sctp_sowwakeup(inp, so); - sctp_sorwakeup(inp, so); - SCTP_SOWAKEUP(so); - } - } - } - /* * Make it invalid too, that way if its about to run it will abort * and return. |
