The branch main has been updated by kp:

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

commit da64f6e047b5f6cd9b9e8450d19072cb0b6e44d0
Author:     Kristof Provost <k...@freebsd.org>
AuthorDate: 2025-08-18 06:49:38 +0000
Commit:     Kristof Provost <k...@freebsd.org>
CommitDate: 2025-08-18 10:04:01 +0000

    pfctl: zero the number of added/deleted addresses
    
    pfctl re-uses nadd between adding the table and adding the addresses, which 
lead
    to potential incorrect numbers if a table was created in addition to 
addresses
    being added.
    
    Sponsored by:   Rubicon Communications, LLC ("Netgate")
---
 sbin/pfctl/pfctl_radix.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/sbin/pfctl/pfctl_radix.c b/sbin/pfctl/pfctl_radix.c
index 0fe9ca8813bb..398c5e998330 100644
--- a/sbin/pfctl/pfctl_radix.c
+++ b/sbin/pfctl/pfctl_radix.c
@@ -122,6 +122,9 @@ pfr_add_addrs(struct pfr_table *tbl, struct pfr_addr *addr, 
int size,
 {
        int ret;
 
+       if (*nadd)
+               *nadd = 0;
+
        ret = pfctl_table_add_addrs_h(pfh, tbl, addr, size, nadd, flags);
        if (ret) {
                errno = ret;

Reply via email to