From 6ebc414625386c9c90f115e1f132af22dc881b43 Mon Sep 17 00:00:00 2001 From: Michael Tuexen Date: Fri, 25 Aug 2023 17:23:34 +0200 Subject: [PATCH] sctp: cleanup No functional change intended. Just asserting the conditions when being called. (cherry picked from commit f0c8e8118dbcc9251b11154ee7e4680f79901af1) --- sys/netinet/sctp_timer.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/sys/netinet/sctp_timer.c b/sys/netinet/sctp_timer.c index ef5eb8b89a5..d0f3f936b34 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, -- 2.45.2