From nobody Fri May 10 20:20:01 2024 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 4VbgGp0bczz5KMKC; Fri, 10 May 2024 20:20:02 +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 4VbgGn72pXz4V9D; Fri, 10 May 2024 20:20:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715372402; 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=bzzCF8y/yrbYKTuQNzDPI3tanTxcgJIxKTvYIbMOvZo=; b=FBbW+cgRsk0zyscnDxiV/lJlotTu/sQOHmJ1S91qVhLEr7/fUbrblrUHWHmuNHOtyqxpRu dTiCrMImc9OK27rU+eBTW4ztdjUduaCF5Z74e9TM/NZi651Jfj0QSDz+wdh8S90eeqr+Of cF50Jmw+UU1bw/2VqDM2iL3XqifLZxw6UWefsER3nw0SuY6m/Q71Fqg1ISnVogGHtQqc5b KgCZTLIHkX43rR8YKEq0sKXPVAKsJjOyM5StNVoQRDF23dr1+0su8+1SQAE0XZhzycFK5E j+Qp5zDKjrvbO/OxYvY3gnsd/Zx51Yze76rGlFccRe1qJKa7TYyTT3Sap2zcOw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715372402; a=rsa-sha256; cv=none; b=NRUKq2b5pGXdePC+RodlqFjwGxOc84vJCWrc4z3syIkC+YsQ5Ta9gLQ0lu0azfUTgBu+bL D/AsHkjLqBhHjAZkDfeGVCDNdVbjCH+RJMqDnI4/fghMfAyTbxUM+G+F5mbx19z6P5DMYe ab29Yn73jfmz2I0TdUOMP+6zJTEw9HwPREtNdY9inasnkfef/m5KSlM4TWGJmx/SyHvJZj n2rbfqj69hSbToaOHvBQ6WKs7WHMGFv1HFW85PSKKl4NsOavB1mhggr6dEDxOGAVCGhPfZ TgsKOLXT6ORoOopqVRPoSgh0LPHg/XvpMd3iXkYWBXl3WzQIDUrf1pSYgS69Sg== 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=1715372402; 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=bzzCF8y/yrbYKTuQNzDPI3tanTxcgJIxKTvYIbMOvZo=; b=si8Q+5V9MQ0mcSz3EtPGZbmORqcj0Mib9wKTk1oScahMd8HPl+n1clqobmDHpqMsheh3xE 4fxY8t0Rn7GafD3Pv9Dsd6KAwsutnzuy0Ib+VkxpxVmQ40NH6c2TrgoGSNfRlUwwpLVxD1 hs74pFWvPjDBdYR00R2op9peS0SKYLx1GV6mTZdYmmOFIMhYNWZD+j1LRIQD4ZnwZQHv8p pV2k/uMZhf0Ems8B/tjeQhZoU84vEoEeahO73QwLkzYyJgtWe9GnIQSz6jN8dGuHGS6QR1 16bA+85YjUfWSPyOIc66tXVVr9eUmUdQrpljF1KQny5um3g17E2Q27qrDdY4og== 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 4VbgGn6X9Dzs44; Fri, 10 May 2024 20:20:01 +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 44AKK1xT082920; Fri, 10 May 2024 20:20:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44AKK1k3082914; Fri, 10 May 2024 20:20:01 GMT (envelope-from git) Date: Fri, 10 May 2024 20:20:01 GMT Message-Id: <202405102020.44AKK1k3082914@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: 5120ea0d8871 - main - sctp: improve heartbeat timer computation PR: 278666 Reviewed by: Albin Hellqvist MFC after: 3 days Pull Request: https://reviews.freebsd.org/D45107 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: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-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: 5120ea0d8871fd5d56a8fb70117b727b9d8a4e62 Auto-Submitted: auto-generated The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=5120ea0d8871fd5d56a8fb70117b727b9d8a4e62 commit 5120ea0d8871fd5d56a8fb70117b727b9d8a4e62 Author: Michael Tuexen AuthorDate: 2024-05-10 18:58:01 +0000 Commit: Michael Tuexen CommitDate: 2024-05-10 19:02:56 +0000 sctp: improve heartbeat timer computation PR: 278666 Reviewed by: Albin Hellqvist MFC after: 3 days Pull Request: https://reviews.freebsd.org/D45107 --- 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 22d45d150544..17e49b413464 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 {