diff options
| author | Michael Tuexen <tuexen@fh-muenster.de> | 2022-04-02 23:05:44 +0200 |
|---|---|---|
| committer | Michael Tuexen <tuexen@fh-muenster.de> | 2022-04-02 23:05:44 +0200 |
| commit | ebb54e4cdb04e1c221aa8654cfebbcf1c907fd68 (patch) | |
| tree | 98e882d595916c0f15734afc835581139b06a0f9 | |
| parent | 121b5f7ebbbc8d5b0025224619311289e4e00b49 (diff) | |
Cleanup
| -rwxr-xr-x | usrsctplib/netinet/sctp_output.c | 40 |
1 files changed, 19 insertions, 21 deletions
diff --git a/usrsctplib/netinet/sctp_output.c b/usrsctplib/netinet/sctp_output.c index a371a97..0c56310 100755 --- a/usrsctplib/netinet/sctp_output.c +++ b/usrsctplib/netinet/sctp_output.c @@ -14094,6 +14094,9 @@ skip_preblock: #if defined(__APPLE__) && !defined(__Userspace__) error = sblock(&so->so_snd, SBLOCKWAIT(flags)); + if (error != 0) { + goto out_unlocked; + } #endif /* sndlen covers for mbuf case * uio_resid covers for the non-mbuf case @@ -14463,26 +14466,7 @@ skip_preblock: error = be.error; } } -#if defined(__APPLE__) && !defined(__Userspace__) - if (error == 0) { - error = sblock(&so->so_snd, SBLOCKWAIT(flags)); - } -#endif - if (error != 0) { - SOCKBUF_UNLOCK(&so->so_snd); - SCTP_TCB_LOCK(stcb); - hold_tcblock = true; - stcb->block_entry = NULL; - if (((asoc->state & SCTP_STATE_ABOUT_TO_BE_FREED) == 0) && - ((asoc->state & SCTP_STATE_WAS_ABORTED) == 0) && - (sp != NULL)) { - sp->processing = 0; - } - goto out_unlocked; - } - } - SOCKBUF_UNLOCK(&so->so_snd); - if (!hold_tcblock) { + SOCKBUF_UNLOCK(&so->so_snd); SCTP_TCB_LOCK(stcb); hold_tcblock = true; stcb->block_entry = NULL; @@ -14494,8 +14478,22 @@ skip_preblock: } else { error = ENOTCONN; } - goto out; + goto out_unlocked; + } + if (error != 0) { + if (sp != NULL) { + sp->processing = 0; + } + goto out_unlocked; } +#if defined(__APPLE__) && !defined(__Userspace__) + error = sblock(&so->so_snd, SBLOCKWAIT(flags)); + if (error != 0) { + goto out_unlocked; + } +#endif + } else { + SOCKBUF_UNLOCK(&so->so_snd); } if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_BLK_LOGGING_ENABLE) { sctp_log_block(SCTP_BLOCK_LOG_OUTOF_BLK, |
