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")
This commit is contained in:
Kristof Provost committed 2025-08-18 12:04:01 +02:00
1 parent 094a60281b
commit da64f6e047
1 file changed
+3
+3
View File
@@ -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;