Page MenuHomeFreeBSD

pf: Fix fallout from the STATE_LOOKUP macro removal
ClosedPublic

Authored by markj on Aug 19 2026, 10:00 PM.
Tags
None
Referenced Files
F172499337: D59015.diff
Fri, Sep 18, 9:24 PM
Unknown Object (File)
Thu, Sep 17, 10:18 AM
Unknown Object (File)
Sat, Sep 12, 10:42 PM
Unknown Object (File)
Sat, Sep 12, 12:22 AM
Unknown Object (File)
Fri, Sep 11, 8:06 AM
Unknown Object (File)
Fri, Sep 11, 5:31 AM
Unknown Object (File)
Wed, Sep 9, 6:46 AM
Unknown Object (File)
Tue, Sep 8, 5:25 PM

Details

Summary

Commit 8572367b6814 ("pf: remove STATE_LOOKUP") introduced two seemingly
unintentional changes with respect to divert(4)-injected packets (i.e.,
the PACKET_LOOPED case): we no longer return the matching state, and
direct callers of pf_find_state() now treat matches of diverted packets
the same as having no matching state at all.

This seems inadvertent, and breaks certain rulesets which use divert-to.
Fix them, and add a regression test case.

Fixes: 8572367b6814 ("pf: remove STATE_LOOKUP")

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 75769
Build 72652: arc lint + arc unit