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
F146467056: D52446.id161784.diff
Mon, Mar 2, 10:27 PM
Unknown Object (File)
Mon, Mar 2, 10:47 AM
Unknown Object (File)
Fri, Feb 27, 8:04 PM
Unknown Object (File)
Tue, Feb 10, 10:27 PM
Unknown Object (File)
Sat, Feb 7, 6:28 PM
Unknown Object (File)
Sat, Feb 7, 5:38 AM
Unknown Object (File)
Jan 27 2026, 1:50 AM
Unknown Object (File)
Jan 16 2026, 8:21 AM

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