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, Apr 23, 7:48 PM
Unknown Object (File)
Thu, Apr 23, 2:01 AM
Unknown Object (File)
Thu, Apr 23, 1:34 AM
Unknown Object (File)
Wed, Apr 22, 2:07 PM
Unknown Object (File)
Sun, Apr 12, 12:57 AM
Unknown Object (File)
Sat, Apr 11, 10:55 PM
Unknown Object (File)
Tue, Apr 7, 1:27 PM
Unknown Object (File)
Mon, Apr 6, 6:33 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