From nobody Tue Feb 22 23:58:33 2022 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 3B23719D0504; Tue, 22 Feb 2022 23:58:34 +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 4K3GMt1D2hz4TP4; Tue, 22 Feb 2022 23:58:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1645574314; 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=qVhHrsU1uj53wLhCazbl5hJ+fy6q73S8hPX7yPwgtaI=; b=ZPLGIkg+9OAGhxHyWMyweaTROlT+/FQvLtrS3CXlcD3k4HXyrs29noKJtt8GC2Zt+Fss+t dZDPsCVDO+ov+HTzVH6WchIACky55BQSxCyW0O0iAuBmqdDrbvliJ+8LEbPyx+tui8d9aL ji5mIQh4zyynF3hXLI6uRlSAcThOhvXEZk7oXOKJxJOsa1rm5En5e/QoLaGhw9u8lb98X6 30lRjVD11FuQhsOOsxIRTy2k/0eUvNeUG0sASKTGjMZF8dpZBLzcIjhPVMdRS5dig44StY npZP+HVEGlE3qHmcx5WetBxkr0mUvur4IC3xScPoVH4skoMe3mLKLoTj6QADtg== 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 09A5C5779; Tue, 22 Feb 2022 23:58:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 21MNwXtc051966; Tue, 22 Feb 2022 23:58:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 21MNwXih051965; Tue, 22 Feb 2022 23:58:33 GMT (envelope-from git) Date: Tue, 22 Feb 2022 23:58:33 GMT Message-Id: <202202222358.21MNwXih051965@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: fe06ce52323f - stable/13 - sctp: minor improvements in sctp_get_frag_point 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: fe06ce52323f4ff6ae032a1d4d2c342504b02648 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1645574314; 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=qVhHrsU1uj53wLhCazbl5hJ+fy6q73S8hPX7yPwgtaI=; b=kfvQIJmNWmLnRfWRscyXg64Qr2utiYVFtdO4GDeacI8Av0I5CJJLw4KKH7AGeeR65sGYhG 4NKwUbQLyJ1MQNfGrRDvj0x/EcBiTCOS/mg0MTCC92wYoVC+OhatvJYhe7tC6RJfkiDwHY SiPHQ/i/23ELizpAIbYUC15pXfpunTaGGP58Mr7pYoHj0cRaBvTDuwNP1dZo8FHD7nj58N X/Ti0lu1VvRHJON/ICQSZ7aGZ0Z0tEpTE0qSxE+MqXPu2JRK9DQq9/YM7c7R1VhibHL25p Vmon17K9VjVfy9eM0Ny+s0jm7sWX/DNhV5vMpHSFInr+xKIiEyw442daQk2tUw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1645574314; a=rsa-sha256; cv=none; b=g31nJTTtTTBWfyg9HFmW4Mg1U6IgaI/JfXe/bjuTMAO6V4Kr+V8lPnKfbBa7reRLEz4tb8 V8mID8atU9miWGmqHPkQEm206hKOTsoBYuKFY5ZC10aLlGMt/4S6/J2CdUyITXo9w25Kj3 ZEL3dL/uqDsYnVCVOmaMoK8AUSTXd6JVm9xyyL/r6q3xSCPBp+ntlzquXWY8OrRt530HFN zEB4oZKrx1Lq5r+qej3tCCFxhQDVsMmmx93gFFIC0GxPG7i5XTtVP/QzuVwcP1tEexGDRx y03Cz3dNSf+ZqmWoQ5kfjYeBT7wGiLUdhlP8n0yEFmQyxIetL44VY4FmT6VfLQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=fe06ce52323f4ff6ae032a1d4d2c342504b02648 commit fe06ce52323f4ff6ae032a1d4d2c342504b02648 Author: Michael Tuexen AuthorDate: 2021-12-28 09:23:31 +0000 Commit: Michael Tuexen CommitDate: 2022-02-22 23:57:06 +0000 sctp: minor improvements in sctp_get_frag_point (cherry picked from commit a7ba00a438a64b34219f2990b3f7348126f7b4ab) --- sys/netinet/sctp_output.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sys/netinet/sctp_output.c b/sys/netinet/sctp_output.c index 8b4a891c23aa..27c384ca5b5a 100644 --- a/sys/netinet/sctp_output.c +++ b/sys/netinet/sctp_output.c @@ -6237,13 +6237,15 @@ sctp_get_frag_point(struct sctp_tcb *stcb) overhead += sctp_get_auth_chunk_len(asoc->peer_hmac_id); } } else { - overhead += sizeof(struct sctp_idata_chunk); + overhead += sizeof(struct sctp_data_chunk); if (sctp_auth_is_required_chunk(SCTP_DATA, asoc->peer_auth_chunks)) { overhead += sctp_get_auth_chunk_len(asoc->peer_hmac_id); } } + KASSERT(overhead % 4 == 0, + ("overhead (%u) not a multiple of 4", overhead)); /* Consider padding. */ - if (asoc->smallest_mtu % 4) { + if (asoc->smallest_mtu % 4 > 0) { overhead += (asoc->smallest_mtu % 4); } KASSERT(asoc->smallest_mtu > overhead,