Index: sys/netpfil/pf/pf.c =================================================================== --- sys/netpfil/pf/pf.c +++ sys/netpfil/pf/pf.c @@ -3563,6 +3563,14 @@ KASSERT(sk != NULL, ("%s: null sk", __func__)); KASSERT(nk != NULL, ("%s: null nk", __func__)); + if (nr->log) { + u_short natreason; + + REASON_SET(&natreason, PFRES_MATCH); + PFLOG_PACKET(kif, m, af, direction, natreason, nr, a, + ruleset, pd, 1); + } + if (pd->ip_sum) bip_sum = *pd->ip_sum; @@ -3791,10 +3799,10 @@ /* apply actions for last matching pass/block rule */ pf_rule_to_actions(r, &pd->act); - if (r->log || (nr != NULL && nr->log)) { + if (r->log) { if (rewrite) m_copyback(m, off, hdrlen, pd->hdr.any); - PFLOG_PACKET(kif, m, af, direction, reason, r->log ? r : nr, a, + PFLOG_PACKET(kif, m, af, direction, reason, r, a, ruleset, pd, 1); }