From nobody Fri Dec 19 17:00:27 2025 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 4dXv1739pSz6M3D8 for ; Fri, 19 Dec 2025 17:00:27 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dXv172dXfz3rxb for ; Fri, 19 Dec 2025 17:00:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766163627; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5oFpleyeKwMlbONtREcF0tfUeax+9wLdhCkS6UarY5Y=; b=BGh8dIZUAISCiD+RaU/AtXO9qO5JIi4zLTKx+GIL/u4QyRg0rWtD+wP7It0crWxD4BRqNw Tur1aRLnQTO0P4xnCJB0qeGsPlx/U9lVDjBFFwFbCfXRjh3XSwA1aviZFD6LnwxKpqLAd+ hI/ePwRrG2IBo8G8Y5JU9NELDj8LVXLwUBsgtmsF+5uAt/3YVX4/HPOU3YrsVJFSGO0WRJ hQxBso7BU0uFtzzplblgXMMvCVIZmbbD4OZXn/ibG0r+Y3xDuF4dtQ2KkWbbCnvam8iLjz hgL5+4RIvhHyMM8AA3V+YDFg/WgmGPRAEAnjS9Je626s8meN0ke5ZwvGUCER9w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766163627; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5oFpleyeKwMlbONtREcF0tfUeax+9wLdhCkS6UarY5Y=; b=KA8cK/QGQrP73xy4WzrSgyOv93/J7I9nn3lF/dLOJJW9wcErEXoWx0U06ey9/38vFV44vt Y0fVqUDMnLwzJoRr4bsNtR8yUEGuTOVR/Lyzcaytxe3DSoLdRocgVZWYe3sgbqHo7uOWmC 3iVPBfG2vtmxhbaBJWmIVGplYCFTzE7mfB1U2JreICU5QV4yE7/Pw+kAYJzfBEa9jN1dFl CpgMO9S4OUU5DflroOascj5Gn+8XV8Xqs1Uef48cEYRXXV5Vh+MJNXZ4Lp3KTFC35h+/fY Ok2Xl00US8M5bsc6SX64NTZl/uIYhzDRFkVBgaVD64Pjit1tiUn0jH16CxbpLQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1766163627; a=rsa-sha256; cv=none; b=UDvp6XtIDTiq3MIPZ9e5O5xXvpmgdzcionyzNwsqizinXzswlnwyBAWyicm+ycbAFu/ceQ V5ESiAhNtejIyCOU3duoXh66admfyEHWMEzTsaHx/Q1sPp9GkSK3YAfNI+Fkj//gKAjxWk sx21P8A/l8HC5cPzfyrTUtgbyYtWZaPzMYcnX4l/cnsOIeMYTbhtUbYKOgvfzLJu8nJ89r Xq5xiSMcLh+sFwI0UZh22vidim8M1Xju/mTvW0Ofj84Udvliroef6OpDoauEPFbFgBoVdN Rp7T2fy1upViukI5NhefqNocjViZlq4jcO03yNooCWB7bJlG7LoerRoOR6AGpA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dXv171txdz1wM for ; Fri, 19 Dec 2025 17:00:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id d516 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 19 Dec 2025 17:00:27 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Cc: Timo =?utf-8?Q?V=C3=B6lker?= From: Michael Tuexen Subject: git: c8b3b605ae85 - main - tcp: fix checksum calculation bug 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/main X-Git-Reftype: branch X-Git-Commit: c8b3b605ae854ead6c8804e0400d80cb8fa73fdf Auto-Submitted: auto-generated Date: Fri, 19 Dec 2025 17:00:27 +0000 Message-Id: <694584ab.d516.79ef3b93@gitrepo.freebsd.org> The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=c8b3b605ae854ead6c8804e0400d80cb8fa73fdf commit c8b3b605ae854ead6c8804e0400d80cb8fa73fdf Author: Timo Völker AuthorDate: 2025-12-19 16:50:20 +0000 Commit: Michael Tuexen CommitDate: 2025-12-19 16:50:20 +0000 tcp: fix checksum calculation bug The new function in_delayed_cksum_o() was introduced to compute the checksum in the case the mbuf chain does not start with the IP header. The offset of the IP header is specified by the parameter iph_offset. If iph_offset was positive, the function computed an incorrect checksum. Reviewed by: sobomax, tuexen Fixes: 5feb38e37847 ("netinet: provide "at offset" variant of the in_delayed_cksum() API") MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D54269 --- sys/netinet/ip_output.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/netinet/ip_output.c b/sys/netinet/ip_output.c index a6b29c6a7612..f1aa3c498ef7 100644 --- a/sys/netinet/ip_output.c +++ b/sys/netinet/ip_output.c @@ -1066,8 +1066,8 @@ in_delayed_cksum_o(struct mbuf *m, uint16_t iph_offset) if (csum == 0) csum = 0xffff; } else { - cklen = ntohs(ip->ip_len); - csum = in_cksum_skip(m, cklen, offset); + cklen = ntohs(ip->ip_len) - (ip->ip_hl << 2); + csum = in_cksum_skip(m, cklen + offset, offset); } offset += m->m_pkthdr.csum_data; /* checksum offset */