Date: Wed, 21 Jan 2026 19:50:15 +0000 From: Michael Tuexen <tuexen@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Cc: Timo =?utf-8?Q?V=C3=B6lker?= <timo.voelker@fh-muenster.de> Subject: git: ba49ad50c0b9 - stable/15 - tcp: fix checksum calculation bug Message-ID: <69712df7.bd5f.494c49ea@gitrepo.freebsd.org>
index | next in thread | raw e-mail
The branch stable/15 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=ba49ad50c0b92dfc2efd97d45bb6e2931dd9aaa3 commit ba49ad50c0b92dfc2efd97d45bb6e2931dd9aaa3 Author: Timo Völker <timo.voelker@fh-muenster.de> AuthorDate: 2025-12-19 16:50:20 +0000 Commit: Michael Tuexen <tuexen@FreeBSD.org> CommitDate: 2026-01-21 19:49:46 +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") Differential Revision: https://reviews.freebsd.org/D54269 (cherry picked from commit c8b3b605ae854ead6c8804e0400d80cb8fa73fdf) --- 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 ef08b9cfd3d6..bd87e9f2d6a6 100644 --- a/sys/netinet/ip_output.c +++ b/sys/netinet/ip_output.c @@ -1067,8 +1067,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 */home | help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?69712df7.bd5f.494c49ea>
