Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 29 Apr 2024 14:36:47 GMT
From:      Kristof Provost <kp@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: a3f7176523e8 - main - libpfctl: fix incorrect pcounters array size
Message-ID:  <202404291436.43TEal4S080557@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by kp:

URL: https://cgit.FreeBSD.org/src/commit/?id=a3f7176523e8611b259cefd7431c01e24f446db7

commit a3f7176523e8611b259cefd7431c01e24f446db7
Author:     Kristof Provost <kp@FreeBSD.org>
AuthorDate: 2024-04-26 14:07:38 +0000
Commit:     Kristof Provost <kp@FreeBSD.org>
CommitDate: 2024-04-29 14:32:23 +0000

    libpfctl: fix incorrect pcounters array size
    
    The array is 2 x 2 x 2, not 2 x 2 x 3.
    
    Sponsored by:   Rubicon Communications, LLC ("Netgate")
    MFC after:      2 weeks
---
 lib/libpfctl/libpfctl.c | 2 +-
 lib/libpfctl/libpfctl.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/libpfctl/libpfctl.c b/lib/libpfctl/libpfctl.c
index 076cfd3400e6..b42afc542273 100644
--- a/lib/libpfctl/libpfctl.c
+++ b/lib/libpfctl/libpfctl.c
@@ -325,7 +325,7 @@ pfctl_get_status(int dev)
 	_pfctl_get_status_counters(nvlist_get_nvlist(nvl, "scounters"),
 	    &status->scounters);
 
-	pf_nvuint_64_array(nvl, "pcounters", 2 * 2 * 3,
+	pf_nvuint_64_array(nvl, "pcounters", 2 * 2 * 2,
 	    (uint64_t *)status->pcounters, NULL);
 	pf_nvuint_64_array(nvl, "bcounters", 2 * 2,
 	    (uint64_t *)status->bcounters, NULL);
diff --git a/lib/libpfctl/libpfctl.h b/lib/libpfctl/libpfctl.h
index 4e06981a79c7..bdb4bfae4be1 100644
--- a/lib/libpfctl/libpfctl.h
+++ b/lib/libpfctl/libpfctl.h
@@ -62,7 +62,7 @@ struct pfctl_status {
 	struct pfctl_status_counters	 lcounters;
 	struct pfctl_status_counters	 fcounters;
 	struct pfctl_status_counters	 scounters;
-	uint64_t	pcounters[2][2][3];
+	uint64_t	pcounters[2][2][2];
 	uint64_t	bcounters[2][2];
 };
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202404291436.43TEal4S080557>