diff --git a/sys/netpfil/pf/pf_table.c b/sys/netpfil/pf/pf_table.c --- a/sys/netpfil/pf/pf_table.c +++ b/sys/netpfil/pf/pf_table.c @@ -569,8 +569,11 @@ if (rv) return (rv); - KASSERT(w.pfrw_free == 0, ("%s: corruption detected (%d)", __func__, - w.pfrw_free)); + if (w.pfrw_free) { + printf("%s: corruption detected (%d).\n", __func__, + w.pfrw_free); + return (ENOTTY); + } *size = kt->pfrkt_cnt; return (0); @@ -623,10 +626,11 @@ return (rv); if (w.pfrw_free) { - printf("pfr_get_astats: corruption detected (%d).\n", + printf("%s: corruption detected (%d).\n", __func__, w.pfrw_free); return (ENOTTY); } + *size = kt->pfrkt_cnt; return (0); }