From nobody Mon Nov 09 23:22:49 2026 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 4jNm6L0l0qz70gJv for ; Mon, 09 Nov 2026 23:22:50 +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) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4jNm6K5sDFz3GYP for ; Mon, 09 Nov 2026 23:22:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1794266569; 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=15Gfgfkp5Yq4kce0szCn/U+LXiTAwq9YYuPFPTbH/hs=; b=NBOi0k0AbCY+slBqZBqpQWL9sIuhnPHiCO3hEfV3oR8EzVIHOGTBd0R/MYA+ExREe0irdi uDF/ZMviWCaHFrDUCIuu3Dyuy5moiYs/phCFIKPNKKcp8bfCCX8jlWI8IfRdQCqGnZ+uiD DWhSc18TEcScqXozGtIYbgXcI9EgBbbNu9HlCzn2/mku5LRRmh16hnGukdp2pdXESA9r/I FzMFfw6pJX0NG/r7q2tFkYDBMmjrJ0O9n/qawoi17EbMVDhdk7GEoEuEIXJBCh4ilArhx4 h22DMJAQ4qlBTTFZtCZ8zn6JDbMYVtaFoCIR7zuR8A2eEZOpEy+Es1NIVe0mtQ== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1794266569; b=im3Ycd0HT7ihvzamMvqOFKG3qENSnEIp1cUghlD/hfBcVPBJg40ZArqYSaPmcHt9eV+ZdK cPwNelj4GIe91UmvOD0z53bPxkZNc96wKgO2MSMpkeUNu2syufAsVQr/6Ntr1leCNU5IYN pwJLV2JEOBCMR/0sWpgRzzbRmt6OzFQuKq5/WSUi4HoWqyq98Lup5b1A89ZYJsnn/i65AV KFiz/EbeTAL6YyCo56qACvTSBQPmwN9Zv14wczX+C//o0D9Twg28HQ/uq7o/JcJicw1YmJ P9wJjLwWoCPXSSvCrFYjqZOaVe/nzFYtF+8reZdFbFAOwa9bdc/wrr+ufovCew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1794266569; 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=15Gfgfkp5Yq4kce0szCn/U+LXiTAwq9YYuPFPTbH/hs=; b=S5McSOq+VZ71jfTB8VT5kCZftZn4x2BO9uk3fBcbf75ROFROves2crwcD0lcFWrnev/ig7 yl4JejQBmVHZ07vX2ItJUNMISHgs6hZ4wEjO+j5qtWqUsdwFGNA+86kP/nKe55rIk6icoH 1aWSUGKANe/31ETt6Xd0GNlabvyeeBLMkNdAbpwTMuyUlu0vIdALo3eBYSNXe1NZP+PDs+ o3F5EoMRBT2g1oV2qrZgKooAtjtcS+mcAPit1zWSpR2GCjUu0c8JPsp7sR0bSGdLDE1iJn H06dipn3o+Gyw7wqJ7KLXEWJ5Qpw63kWvHizOIZYbe7QArlDv/88oMbjN285yw== 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 4jNm6K5X1yz12mK for ; Mon, 09 Nov 2026 23:22:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 9db2 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 09 Nov 2026 23:22:49 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Cy Schubert Subject: git: 86861520613f - main - ipfilter: Remove erroneous ntohs() List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org List-Id: Commit messages for all branches of the src repository List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 86861520613f99c85b5fbdf92b5c955a13ed6624 Auto-Submitted: auto-generated Date: Mon, 09 Nov 2026 23:22:49 +0000 Message-Id: <6af255c9.9db2.513e412b@gitrepo.freebsd.org> The branch main has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=86861520613f99c85b5fbdf92b5c955a13ed6624 commit 86861520613f99c85b5fbdf92b5c955a13ed6624 Author: Cy Schubert AuthorDate: 2026-11-09 23:13:21 +0000 Commit: Cy Schubert CommitDate: 2026-11-09 23:22:44 +0000 ipfilter: Remove erroneous ntohs() The original commit was wrong. ipf_nat_builddivertmp() builds the UDP template with the length in host byte order M_DUP() copies that value unchanged. The old code was therefore correct. It added fin_plen in host order and then did a single htons(). The original patch was discussed with Co-Pilot, which pointed out the original bug. claude-opus-5-5 discovered the ntohs() error that co-pilot suggested. Interestingly this code had been running here for a couple of months. Reported by: llm-postcr Fixes: 72cc9e3766f4 --- sys/netpfil/ipfilter/netinet/ip_nat.c | 1 - 1 file changed, 1 deletion(-) diff --git a/sys/netpfil/ipfilter/netinet/ip_nat.c b/sys/netpfil/ipfilter/netinet/ip_nat.c index c8125c10e3f0..4b4890587f53 100644 --- a/sys/netpfil/ipfilter/netinet/ip_nat.c +++ b/sys/netpfil/ipfilter/netinet/ip_nat.c @@ -5156,7 +5156,6 @@ ipf_nat_out(fr_info_t *fin, nat_t *nat, int natadd, u_32_t nflags) if (ip->ip_p == IPPROTO_UDP) { uh = (udphdr_t *)(ip + 1); - uh->uh_ulen = ntohs(uh->uh_ulen); uh->uh_ulen += fin->fin_plen; uh->uh_ulen = htons(uh->uh_ulen); }