[Bug 260406] pfctl: Cannot allocate memory (after a time)

From: <bugzilla-noreply_at_freebsd.org>
Date: Fri, 24 Dec 2021 10:24:15 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=260406

--- Comment #35 from Kristof Provost <kp@freebsd.org> ---
(In reply to Andriy Gapon from comment #31)
This should prevent the table limit from being set, so it's a little narrower
than just disabling the limit for everything:

diff --git a/sys/netpfil/pf/pf_table.c b/sys/netpfil/pf/pf_table.c
index 4cfe5d61e83e..859d5ad79775 100644
--- a/sys/netpfil/pf/pf_table.c
+++ b/sys/netpfil/pf/pf_table.c
@@ -209,7 +209,6 @@ pfr_initialize(void)
        V_pfr_kentry_z = uma_zcreate("pf table entries",
            sizeof(struct pfr_kentry), NULL, NULL, NULL, NULL, UMA_ALIGN_PTR,
            0);
-       V_pf_limits[PF_LIMIT_TABLE_ENTRIES].zone = V_pfr_kentry_z;
        V_pf_limits[PF_LIMIT_TABLE_ENTRIES].limit = PFR_KENTRY_HIWAT;
 }
diff --git a/sbin/pfctl/pfctl.c b/sbin/pfctl/pfctl.c
index a0eec1b09289..22c689934c2d 100644
--- a/sbin/pfctl/pfctl.c
+++ b/sbin/pfctl/pfctl.c
@@ -1918,6 +1918,9 @@ pfctl_load_limit(struct pfctl *pf, unsigned int index,
unsigned int limit)
 {
        struct pfioc_limit pl;

+       if (index == PF_LIMIT_TABLE_ENTRIES)
+               return (0);
+
        memset(&pl, 0, sizeof(pl));
        pl.index = index;
        pl.limit = limit;

-- 
You are receiving this mail because:
You are the assignee for the bug.