Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 15 Sep 2023 17:33:06 GMT
From:      Michael Tuexen <tuexen@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: 351792d4cfd1 - stable/14 - sctp: cleanup
Message-ID:  <202309151733.38FHX6tq038844@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/14 has been updated by tuexen:

URL: https://cgit.FreeBSD.org/src/commit/?id=351792d4cfd1a7f7337472870f207004789db2a4

commit 351792d4cfd1a7f7337472870f207004789db2a4
Author:     Michael Tuexen <tuexen@FreeBSD.org>
AuthorDate: 2023-08-25 15:23:34 +0000
Commit:     Michael Tuexen <tuexen@FreeBSD.org>
CommitDate: 2023-09-15 17:30:51 +0000

    sctp: cleanup
    
    No functional change intended. Just asserting the conditions when
    being called.
---
 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 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,



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202309151733.38FHX6tq038844>