From nobody Wed Nov 05 15:33:58 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 4d1q9g1rvSz6GTd3; Wed, 05 Nov 2025 15:33:59 +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 4d1q9g0yNrz3FW5; Wed, 05 Nov 2025 15:33:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1762356839; 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=mvDbgBWF/QxGc/KGVPJ1PXofaRka9czXQIbJM7PjeHU=; b=koaHSUCSxJ4KGcFg+kZd4hrui/QgHQP21+dfs71bnCS8x8j3Zu7WTEaRcPe6eCM4O+xaDU U3nle+gIajaYG5BgGvFKcwp93Dl7dWsxJpfZ7+d9Xmla06jZUrkungOZfVtjfRK8dRbdLS QR4vhGT1EivCB8s8PwQi3FimStUusxJK/7kzDcRoeMFUWJGkgn05s4DUtC2SlOUVLRXn+T Qq/9G/y+OAAi/JAFSFZay9jDGClfXCXO6jH0X7G/xAvf/c3oLLMB19Q5NEcoZG9GIApY18 BJvtlGGn6x5bd0NOoZwhozAwuEE02pxN91rZ4lb8bVcVpzR6m03XvhN/XIKbIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1762356839; 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=mvDbgBWF/QxGc/KGVPJ1PXofaRka9czXQIbJM7PjeHU=; b=iEEbuML1cgYUUDgRC9lhCV9qeHjBNhj7OdTLGQvhn8Ol4eea0yMs++WMRSd2kHJFNzCbs4 Nzuh6UmeWmd4rI1uMhf843ZPI4T5U7i5Y/P7DxTp+RzGAyKX/1/7xKe++mWJ6x3kdqumRC EYeTIuH1mNfJerzH/LynsR/kXMqY1FyTSX5N4Y/AcofJ4Of9c5Gyoy5bQzRCOPCpXUPWgB yAVvHpzggGOx63cfvkzpJCyUhMrxcZnbAdP4Zo+vy89/3rNwlUab7lli5QiBhSFYTqZrvG i5tF61KRgA0ECglggTl6oHKLkd/7Khrz8yQniTM97JupQ6l2EdI0lUxm2vWY4Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1762356839; a=rsa-sha256; cv=none; b=SR6gfSgeHKA2W6dlx2XPW3rgmBnhUEcOHx5LnvJP9ZIVIv8cWnx5fIP2Q6cEua9LL/AGLp 6P/v4OBC3EA09E+bNOu+ypT2BKVdDvN/6jdAxoJNoycUWKXjDVCAH0SZBFYGA97fVPX44u RYdS9eIw3SMsKcs31Ty36HBb30wkSrDTYoD0CnhS+PcyuJHIz8Y72CbWc/mNHgNcxmBq0Y fIVbhy0rYXSij0zMlHrETui1glLXbdZGz7M5bfuTS1qKIvEL3C0GaIELrw5a4ZJrGlhp7A NfQRBJlIVXASuOeoI+1f4agpjpoEYy40zlw1GBui0j5fkE7FJl2RuKahpJ3jdA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none 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 4d1q9g0Xtpzq6W; Wed, 05 Nov 2025 15:33:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5A5FXwOJ033200; Wed, 5 Nov 2025 15:33:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5A5FXw5v033197; Wed, 5 Nov 2025 15:33:58 GMT (envelope-from git) Date: Wed, 5 Nov 2025 15:33:58 GMT Message-Id: <202511051533.5A5FXw5v033197@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Cy Schubert Subject: git: ab3c9853285b - main - ipfilter: Calculate the number of elements in ipf_errors 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: cy X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ab3c9853285b4907dac147ce2f818e3fb44df5a3 Auto-Submitted: auto-generated The branch main has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=ab3c9853285b4907dac147ce2f818e3fb44df5a3 commit ab3c9853285b4907dac147ce2f818e3fb44df5a3 Author: Cy Schubert AuthorDate: 2025-10-23 02:11:20 +0000 Commit: Cy Schubert CommitDate: 2025-11-05 15:32:16 +0000 ipfilter: Calculate the number of elements in ipf_errors It serves no purpose to manually manage the IPF_NUM_ERRORS count. Calculate it instead. Reviewed by: emaste, markj MFC after: 1 week Differential revision: https://reviews.freebsd.org/D53308 --- sbin/ipf/libipf/interror.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sbin/ipf/libipf/interror.c b/sbin/ipf/libipf/interror.c index 981823ca6bb9..cbfb210c85d3 100644 --- a/sbin/ipf/libipf/interror.c +++ b/sbin/ipf/libipf/interror.c @@ -17,7 +17,7 @@ typedef struct { static ipf_error_entry_t *find_error(int); -#define IPF_NUM_ERRORS 477 +#define IPF_NUM_ERRORS sizeof(ipf_errors) / sizeof(ipf_error_entry_t) /* * NO REUSE OF NUMBERS! @@ -25,7 +25,7 @@ static ipf_error_entry_t *find_error(int); * IF YOU WANT TO ADD AN ERROR TO THIS TABLE, _ADD_ A NEW NUMBER. * DO _NOT_ USE AN EMPTY NUMBER OR FILL IN A GAP. */ -static ipf_error_entry_t ipf_errors[IPF_NUM_ERRORS] = { +static ipf_error_entry_t ipf_errors[] = { { 1, "auth table locked/full" }, { 2, "" }, { 3, "copyinptr received bad address" },