From nobody Thu Aug 01 21:09:34 2024 X-Original-To: dev-commits-src-all@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 4WZhRg0sk9z5RSWB; Thu, 01 Aug 2024 21:09:35 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WZhRg0L2Qz4RPq; Thu, 1 Aug 2024 21:09:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722546575; 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=j8y/cGIMK/sUmlju4uAv2a7BKaWrszcgTDpt0WyQVd4=; b=wrcoucqQbph2ajbYxnuiLrLoZak/lJ/1iykjCMLEGHL7S3ydJrmmfe3Z27dA2M6yI3wboo aqP91h4nL2IjN4rPyGNKJ34CxW5dlFzElHRHUR075SsU/vCNOta/T+rKV6fjxXAKKTCMLK 1k09WJLV02PEZPFkJOz+MDRkuitStgcvOkjfwW2pb2udOdnyWqEONaNBlE9DCC99GBGvuv AfkzKgijiGQDu2yh9qzm/iqNq9nCdBgMzCbJ9kqICi/zdrTmVtMoQ8MjidtDaWahns06cl Nzd6zQOXI6JJ25dcTFXsX+HYohzb7IeCz7aV8R4z5aFbkfyR8GhIeASBkcndhQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722546575; a=rsa-sha256; cv=none; b=CD+U2VzOwMzmFpJMlRl2oXDzh1OEkpHwxZ98mq5x2Lf7Xf/n93p2QrPM+9bZCVAjaHqt3M XR378MbD0yRFbma79BINfssyffodN6/7HPUPT9FF7vpjSGZdlJB9mgI4Wy8J+WzAA36xqV 3deB+FnSa4Lv794YNPcGlwnwH2xhDUlTcK9to+AdQ/VEfWqtNHeR9wgd6puyaEBbnV7dXz GzPsw/qvTiOLruVxiLTB0pFXUxKzUenHZ2+KAiP9mcJ8pJcVWCZdf5fgZJ1+1EJYzztavS 1joObbG5BJuP0268GcEWULp+dYBW2Juakvk/w1jzLADG2PNiAI2CdzUkguGTSw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722546575; 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=j8y/cGIMK/sUmlju4uAv2a7BKaWrszcgTDpt0WyQVd4=; b=uDpo5jKiphZr2XmlN0EI/zcccO5ZhndjweGwk12gHAORJoklXsXhmQBjjpfieZCu5+9yz1 492yeB73AluTHdRYv+JIaXRSRxNMD0aXu6bLoUCuzqncBCqcQXK/kw/LRE+4pfKC4i6RjC wQcrqFyrwQ3prBMZ5SbrHmlTLG2mhlS7H8dlsuzCL7V0cNYOEYZeK7dnS2n044ca60ssX8 9/SsVvF4t/rKw/2o7iRreRvx/OTDLRIsL3P2tbKgV+u/wuOfW+qnRdM71VyXK6/wUrByte CP9RyT9eI6kpSMXR+Sbn8dPQI7lu0y145GLXQwJVN7Rjix+Cv73vlonv4c6T3A== 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 4WZhRf73xGz11DS; Thu, 1 Aug 2024 21:09:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 471L9Y8S091957; Thu, 1 Aug 2024 21:09:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 471L9Y4m091954; Thu, 1 Aug 2024 21:09:34 GMT (envelope-from git) Date: Thu, 1 Aug 2024 21:09:34 GMT Message-Id: <202408012109.471L9Y4m091954@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: 162c10990fdd - stable/13 - sctp: improve heartbeat timer computation List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@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/stable/13 X-Git-Reftype: branch X-Git-Commit: 162c10990fdd2f82d479598f39af250191928453 Auto-Submitted: auto-generated The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=162c10990fdd2f82d479598f39af250191928453 commit 162c10990fdd2f82d479598f39af250191928453 Author: Michael Tuexen AuthorDate: 2024-05-10 18:58:01 +0000 Commit: Michael Tuexen CommitDate: 2024-08-01 21:09:03 +0000 sctp: improve heartbeat timer computation PR: 278666 Reviewed by: Albin Hellqvist Pull Request: https://reviews.freebsd.org/D45107 (cherry picked from commit 5120ea0d8871fd5d56a8fb70117b727b9d8a4e62) --- sys/netinet/sctputil.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/sys/netinet/sctputil.c b/sys/netinet/sctputil.c index 68484409d038..40a7500fc69c 100644 --- a/sys/netinet/sctputil.c +++ b/sys/netinet/sctputil.c @@ -2287,19 +2287,19 @@ sctp_timer_start(int t_type, struct sctp_inpcb *inp, struct sctp_tcb *stcb, } else { to_ticks = net->RTO; } - rndval = sctp_select_initial_TSN(&inp->sctp_ep); - jitter = rndval % to_ticks; - if (to_ticks > 1) { - to_ticks >>= 1; - } - if (jitter < (UINT32_MAX - to_ticks)) { - to_ticks += jitter; - } else { - to_ticks = UINT32_MAX; - } if (!((net->dest_state & SCTP_ADDR_UNCONFIRMED) && (net->dest_state & SCTP_ADDR_REACHABLE)) && ((net->dest_state & SCTP_ADDR_PF) == 0)) { + if (to_ticks > 1) { + rndval = sctp_select_initial_TSN(&inp->sctp_ep); + jitter = rndval % to_ticks; + to_ticks >>= 1; + if (jitter < (UINT32_MAX - to_ticks)) { + to_ticks += jitter; + } else { + to_ticks = UINT32_MAX; + } + } if (net->heart_beat_delay < (UINT32_MAX - to_ticks)) { to_ticks += net->heart_beat_delay; } else {