From nobody Sat Aug 03 22:28:20 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 4Wby5c4mcKz5RRsf; Sat, 03 Aug 2024 22: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wby5c49lcz4GtM; Sat, 3 Aug 2024 22: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=1722724100; 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=dUleuJXGCt9zKFLW9rVHaquyMDXIXoNj3QhT8LL8oZo=; b=GCMDlimvQn81Leo6K0xiuADZq+9yluQEFm1MPF4x4qISUVKgGYPfCFYdgrc3ZwcVyCt0zY /psMFtMQSrs242ZEwNUmUWd+70EhTqOrcVPBo41U8d5EzS0JR6qwTcgNgb/gIyiGmOThGB qH4psREVo6/5XXxbjzsvIXgWrvd1oYRjywkzsfdnoTXiyuqHdG/pqXKKhlpErNKmfd+ws9 UrEz5EiGkuuvoIMt+8Tc8Quq99kke5OZz7elPXhSSiw/9FTHNbXHY4/rOnrcE7omAJKZU6 KKA+75rdIApX6KV7O0cBXc6SWaTfzzu+FLM4FNfYExXrOOWP9H3GL91HAjMEvQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722724100; a=rsa-sha256; cv=none; b=prXNkSAbbJC0f7tClcq+6XO/kZKVwMXwBi5OAyhreeN1y+64kPZV/3PnVkRL0s49fwwTpo HoiWTEopbWRyr3se4k6XkThIBP7ZB9foH24ZoO1MMRLjRCBtzczMqQsNrr4acGRhO/cZHY 1JO23qCKqDMZ1yMYkrhBPQLFvwMiOqmFhpXEAuM6G4EGg433K+PuHUWNIkHwzhv9XwfiXF 2kAqlq/3VD0fUMYexRUVy7ZLAl4+RyyfcP24Fvk4lzBSgmGn13C5nKb1K9JkUb77ef/AOU S9mgzuH25YjTy46/Iy/WfFmSdmtyNq333jBhks6rBn9oAhp4TqcbcAWyOrfazQ== 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=1722724100; 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=dUleuJXGCt9zKFLW9rVHaquyMDXIXoNj3QhT8LL8oZo=; b=xdjmxMCWRKRcp6Idr1ZjDEOfPqmMO0i3erFH/glGO8Afvu/TJ9UAjwpQJJX4TPn+KvaplF H4tmE7v6SXPwN3DmTREiLiUeGi7zkg52416DWjQnXtE1mPaVa4qTYqRB3tiiUCCf2Gd1Au jhRPPIh8k50fUQJGecP2xk1K3D6y0Ps9Uv7TOgRxfuntew1Ut7Gg1PslZPEibaTXmwSCQ0 qJ1b0RwiqMN2AMJF7vre7nvkEP0uMfTTgDi9laE1sMhl0XN5hRo5PoMYcBZqiEJtxVH2tV yiNDF+YxRrVghH6fi7pYqspjYdTeAKchjGL+eJvfv2K5BOnOd36YqgxG8w9tRw== 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 4Wby5c3dskzV5y; Sat, 3 Aug 2024 22:28:20 +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 473MSK3F026937; Sat, 3 Aug 2024 22:28:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 473MSKBx026934; Sat, 3 Aug 2024 22:28:20 GMT (envelope-from git) Date: Sat, 3 Aug 2024 22:28:20 GMT Message-Id: <202408032228.473MSKBx026934@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: fc40509e72ef - stable/14 - 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/14 X-Git-Reftype: branch X-Git-Commit: fc40509e72efe4f9249f48bbe48098690a709fb3 Auto-Submitted: auto-generated The branch stable/14 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=fc40509e72efe4f9249f48bbe48098690a709fb3 commit fc40509e72efe4f9249f48bbe48098690a709fb3 Author: Michael Tuexen AuthorDate: 2024-05-10 18:58:01 +0000 Commit: Michael Tuexen CommitDate: 2024-08-03 22:27:53 +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 e963c5cb466e..fd11a7ece5b7 100644 --- a/sys/netinet/sctputil.c +++ b/sys/netinet/sctputil.c @@ -2289,19 +2289,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 {