summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartijn van Duren <martijn@cvs.openbsd.org>2024-07-10 20:33:32 +0000
committerMartijn van Duren <martijn@cvs.openbsd.org>2024-07-10 20:33:32 +0000
commitf3ffc613518e2e7330714b7de6c9c85e74218603 (patch)
treed7dfb163294661b48d249c1960aacf358aea7bba
parent34cd924f3f170891cef009e9bcbf947be64f54c5 (diff)
Allow pfIfTable to have more than 64 entries.
Taken from pfctl_table.c r1.85 by sashan@ OK tb@
-rw-r--r--libexec/snmpd/snmpd_metrics/pf.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libexec/snmpd/snmpd_metrics/pf.c b/libexec/snmpd/snmpd_metrics/pf.c
index 5c354161e8a..f614b975c1d 100644
--- a/libexec/snmpd/snmpd_metrics/pf.c
+++ b/libexec/snmpd/snmpd_metrics/pf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pf.c,v 1.1 2022/09/01 14:20:33 martijn Exp $ */
+/* $OpenBSD: pf.c,v 1.2 2024/07/10 20:33:31 martijn Exp $ */
/*
* Copyright (c) 2012 Joel Knight <joel@openbsd.org>
@@ -210,11 +210,11 @@ pfi_get(struct pfr_buffer *b, const char *filter)
bzero(b, sizeof(struct pfr_buffer));
b->pfrb_type = PFRB_IFACES;
for (;;) {
- pfr_buf_grow(b, b->pfrb_size);
+ pfr_buf_grow(b, 0);
b->pfrb_size = b->pfrb_msize;
if (pfi_get_ifaces(filter, b->pfrb_caddr, &(b->pfrb_size)))
return (1);
- if (b->pfrb_size <= b->pfrb_msize)
+ if (b->pfrb_size < b->pfrb_msize)
break;
}