Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 18 Aug 2025 10:07:59 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: da64f6e047b5 - main - pfctl: zero the number of added/deleted addresses
Message-ID:  <202508181007.57IA7xmY056029@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=da64f6e047b5f6cd9b9e8450d19072cb0b6e44d0

commit da64f6e047b5f6cd9b9e8450d19072cb0b6e44d0
Author:     Kristof Provost <kp@FreeBSD.org>
AuthorDate: 2025-08-18 06:49:38 +0000
Commit:     Kristof Provost <kp@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;



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