sctp: improve consistency
This is simplifying a patch to address PR 260116. PR: 260116 MFC after: 1 week
This commit is contained in:
@@ -5044,11 +5044,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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6125,7 +6121,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);
|
||||
|
||||
@@ -253,11 +253,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)
|
||||
|
||||
Reference in New Issue
Block a user