Page MenuHomeFreeBSD

pf: Always skip outbound filtering for inbound af-to rules
ClosedPublic

Authored by vegeta_tuxpowered.net on Sep 9 2025, 1:20 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Mar 26, 11:36 AM
Unknown Object (File)
Fri, Mar 20, 12:41 PM
Unknown Object (File)
Fri, Mar 20, 7:02 AM
Unknown Object (File)
Thu, Mar 19, 9:44 PM
Unknown Object (File)
Mon, Mar 2, 10:27 PM
Unknown Object (File)
Mar 2 2026, 10:47 AM
Unknown Object (File)
Feb 27 2026, 8:04 PM
Unknown Object (File)
Feb 10 2026, 10:27 PM

Details

Summary

The af-to rules on inbound direction create a single state spanning both the
inbound and the outbound interface. Calling pf_test() for the outbound
direction in pf_route() makes the packet pass through state search, match
the existing state, never evaluate the ruleset, and increase state counters.

Check that the state comes from an af-to rule in inbound direction, and if
yes, skip outbound testing.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable