aboutsummaryrefslogtreecommitdiff
path: root/sbin
diff options
context:
space:
mode:
authorKristof Provost <kp@FreeBSD.org>2026-02-13 16:21:33 +0000
committerKristof Provost <kp@FreeBSD.org>2026-02-16 12:42:50 +0000
commit281282e9357b95b679d36ca6d8561e96c1263937 (patch)
tree116fdccfb97bba48b7c1ea27b56dc295999e4074 /sbin
parent4ccca2100887943b11187787004bc8efc2a149c6 (diff)
Diffstat (limited to 'sbin')
-rw-r--r--sbin/pfctl/pfctl_radix.c21
1 files changed, 7 insertions, 14 deletions
diff --git a/sbin/pfctl/pfctl_radix.c b/sbin/pfctl/pfctl_radix.c
index e8d3a1b8dcc3..608c22141ae8 100644
--- a/sbin/pfctl/pfctl_radix.c
+++ b/sbin/pfctl/pfctl_radix.c
@@ -214,25 +214,18 @@ int
pfr_tst_addrs(struct pfr_table *tbl, struct pfr_addr *addr, int size,
int *nmatch, int flags)
{
- struct pfioc_table io;
+ int ret;
if (tbl == NULL || size < 0 || (size && addr == NULL)) {
errno = EINVAL;
return (-1);
}
- bzero(&io, sizeof io);
- io.pfrio_flags = flags;
- io.pfrio_table = *tbl;
- io.pfrio_buffer = addr;
- io.pfrio_esize = sizeof(*addr);
- io.pfrio_size = size;
- if (ioctl(dev, DIOCRTSTADDRS, &io)) {
- pfr_report_error(tbl, &io, "test addresses in");
- return (-1);
- }
- if (nmatch)
- *nmatch = io.pfrio_nmatch;
- return (0);
+
+ ret = pfctl_test_addrs(pfh, tbl, addr, size, nmatch, flags);
+ if (ret != 0)
+ errno = ret;
+
+ return (ret);
}
int