pf: only force state failure logging if logging was requested

PR: https://forum.opnsense.org/index.php?topic=45801.0
Fixes: 1a2a481
This commit is contained in:
Franco Fichtner 2025-03-12 11:19:58 +01:00
parent 77f8132af9
commit 4f4ebd2896

View file

@ -5084,7 +5084,9 @@ pf_test_rule(struct pf_krule **rm, struct pf_kstate **sm, struct pfi_kkif *kif,
hdrlen, &match_rules);
sk = nk = NULL;
if (action != PF_PASS) {
pd->act.log |= PF_LOG_FORCE;
/* XXX force drop log only for eligible rules */
if (r->log || (nr != NULL && nr->log))
pd->act.log |= PF_LOG_FORCE;
if (action == PF_DROP &&
(r->rule_flag & PFRULE_RETURN))
pf_return(r, nr, pd, off, m, th, kif,