Skip to content

Commit

Permalink
Improve consistency
Browse files Browse the repository at this point in the history
  • Loading branch information
tuexen committed Jul 28, 2023
1 parent 95ac813 commit 130ddb1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 11 deletions.
8 changes: 2 additions & 6 deletions usrsctplib/netinet/sctputil.c
Original file line number Diff line number Diff line change
Expand Up @@ -5544,11 +5544,7 @@ sctp_free_bufspace(struct sctp_tcb *stcb, struct sctp_association *asoc,
if ((stcb->sctp_socket != NULL) &&
(((stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL)) ||
((stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE)))) {
if (stcb->sctp_socket->so_snd.sb_cc >= tp1->book_size) {
atomic_subtract_int(&((stcb)->sctp_socket->so_snd.sb_cc), tp1->book_size);
} else {
stcb->sctp_socket->so_snd.sb_cc = 0;
}
SCTP_SAVE_ATOMIC_DECREMENT(&stcb->sctp_socket->so_snd.sb_cc, tp1->book_size);
}
}

Expand Down Expand Up @@ -6758,7 +6754,7 @@ sctp_sorecvmsg(struct socket *so,
if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_SB_LOGGING_ENABLE) {
sctp_sblog(&so->so_rcv, control->do_not_ref_stcb?NULL:stcb, SCTP_LOG_SBFREE, (int)cp_len);
}
atomic_subtract_int(&so->so_rcv.sb_cc, (int)cp_len);
SCTP_SAVE_ATOMIC_DECREMENT(&so->so_rcv.sb_cc, (int)cp_len);
if ((control->do_not_ref_stcb == 0) &&
stcb) {
atomic_subtract_int(&stcb->asoc.sb_cc, (int)cp_len);
Expand Down
6 changes: 1 addition & 5 deletions usrsctplib/netinet/sctputil.h
Original file line number Diff line number Diff line change
Expand Up @@ -288,11 +288,7 @@ do { \
} \
if (stcb->sctp_socket && ((stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || \
(stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL))) { \
if (stcb->sctp_socket->so_snd.sb_cc >= sp->length) { \
atomic_subtract_int(&stcb->sctp_socket->so_snd.sb_cc,sp->length); \
} else { \
stcb->sctp_socket->so_snd.sb_cc = 0; \
} \
SCTP_SAVE_ATOMIC_DECREMENT(&stcb->sctp_socket->so_snd.sb_cc, sp->length); \
} \
} \
} while (0)
Expand Down

0 comments on commit 130ddb1

Please sign in to comment.