aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Tuexen <tuexen@FreeBSD.org>2023-08-25 15:23:34 +0000
committerMichael Tuexen <tuexen@FreeBSD.org>2024-01-11 12:49:44 +0000
commit6ebc414625386c9c90f115e1f132af22dc881b43 (patch)
treee66c3127e59537af54bbf92a16aa41e601ee2d74
parent608c8658c8c9e78ccce884e137ac341366653e01 (diff)
downloadsrc-6ebc414625386c9c90f115e1f132af22dc881b43.tar.gz
src-6ebc414625386c9c90f115e1f132af22dc881b43.zip
sctp: cleanup
No functional change intended. Just asserting the conditions when being called. (cherry picked from commit f0c8e8118dbcc9251b11154ee7e4680f79901af1)
-rw-r--r--sys/netinet/sctp_timer.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/sys/netinet/sctp_timer.c b/sys/netinet/sctp_timer.c
index ef5eb8b89a5d..d0f3f936b34d 100644
--- a/sys/netinet/sctp_timer.c
+++ b/sys/netinet/sctp_timer.c
@@ -87,7 +87,10 @@ static int
sctp_threshold_management(struct sctp_inpcb *inp, struct sctp_tcb *stcb,
struct sctp_nets *net, uint16_t threshold)
{
- if (net) {
+ KASSERT(stcb != NULL, ("stcb is NULL"));
+ SCTP_TCB_LOCK_ASSERT(stcb);
+
+ if (net != NULL) {
net->error_count++;
SCTPDBG(SCTP_DEBUG_TIMER4, "Error count for %p now %d thresh:%d\n",
(void *)net, net->error_count,
@@ -114,11 +117,6 @@ sctp_threshold_management(struct sctp_inpcb *inp, struct sctp_tcb *stcb,
sctp_timer_start(SCTP_TIMER_TYPE_HEARTBEAT, inp, stcb, net);
}
}
- }
- if (stcb == NULL)
- return (0);
-
- if (net) {
if ((net->dest_state & SCTP_ADDR_UNCONFIRMED) == 0) {
if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_THRESHOLD_LOGGING) {
sctp_misc_ints(SCTP_THRESHOLD_INCR,