From nobody Fri Aug 25 15:28:20 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4RXP3m2xq4z4rRXb; Fri, 25 Aug 2023 15:28:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4RXP3m2LDTz4hT8; Fri, 25 Aug 2023 15:28:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1692977300; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EctklE4VLibJFSocWuD84WPnf7CSztRjDji/9SE+SrE=; b=KcxVDHaG5BOlvzo+Ai/RO5prEwpJsnb0Ih3xv6d+1NtLxQXPMmxoaBAXrBCT1FUUaR6cxm cZrUltyoMLq1cx7akAmd7l6eppPHL+RMkkop5YMst4RxWbgRaFENBvtJMYUxuC7VD0Ghcc 6hSCm8dbuDjruGSpUdxgqemvknui2ruNYakK/Z7hslwdxm7IqZRU8rcNen1uiAbvQUGXGR C2cxUB/Sq9jAUQ6bWh9ANcrLiv56bYOf8cnIWm7R1m39Fiv//J9L/jXipLI86tlarhy/zJ rfujexD60v4zeotBLYl/G0CdASNsq+5LO1xRmJorBN/GdDtWfqVLp+X+IPm6mQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1692977300; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EctklE4VLibJFSocWuD84WPnf7CSztRjDji/9SE+SrE=; b=xIMoBXDQ4jDt7JjqI6MyvcTH68gXyeb9HhYvbIUvWNYBMauuiNH/UlO4mbc+oIwmZhjoKR IJ+CXvQ8IRFL7/8cZhPO8xsHkkblWgvKrp21AaRTP34/7SV94j4h5TM0oHhZE7hnC5MM4n Y9hJ3bjHQROlKyr+RrRJ8juhH8kQopjJJCMSb+E/nO+dscRI59WxnNIlSM15WRVUdeMqck e2Xng4+sO3aKrLqLkAnkeMt1NurYN9p2yDoTex5Rxu5wCF1iABiTHknNzffJnINYUlW1aB oV2D0QSYL90DPt0CsqfBjvGQ9Nu+hRm60lDvZsWmMp0PDfp+ZwYCxzB+PZulBw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1692977300; a=rsa-sha256; cv=none; b=t3KjcHCBvU/ORGpnEAUD3qs73oKOI0sfR0gLjGqiL766bVspsAWpIfmH1NhGWzQAp4Cxol WImQ1BSJEcFLVxAG2FRUqNAiR4NQQ+69qjD/cvhoevnwq6bE5OPyh1AI31c56CtJGobNNw qjwAQb8E1/BIfZPX3Npc04TIn1cyzDCIs4Lfn3GRrwJdWT2JtS3a0jmNUnz04QUUebRLXe P82EILlBtdPBrH1xicnQyGWH7cCmE2dCeTSGoqBtRmDolDeH+tOtZdBElkn+mZyi1yuc9H BpxfCXv9OCRgYnwCkpPVZs019yZUFbfGApvrnWGI13p+3q497MPScfQjVNtiQQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4RXP3m1Nsjz1Cn0; Fri, 25 Aug 2023 15:28:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 37PFSKwB085036; Fri, 25 Aug 2023 15:28:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 37PFSKK2085033; Fri, 25 Aug 2023 15:28:20 GMT (envelope-from git) Date: Fri, 25 Aug 2023 15:28:20 GMT Message-Id: <202308251528.37PFSKK2085033@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Tuexen Subject: git: f0c8e8118dbc - main - sctp: cleanup List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f0c8e8118dbcc9251b11154ee7e4680f79901af1 Auto-Submitted: auto-generated The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=f0c8e8118dbcc9251b11154ee7e4680f79901af1 commit f0c8e8118dbcc9251b11154ee7e4680f79901af1 Author: Michael Tuexen AuthorDate: 2023-08-25 15:23:34 +0000 Commit: Michael Tuexen CommitDate: 2023-08-25 15:26:58 +0000 sctp: cleanup No functional change intended. Just asserting the conditions when being called. MFC after: 1 week --- 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,