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
F174384641: D59015.id185217.diff
Fri, Oct 2, 8:20 PM
F174335299: D59015.diff
Fri, Oct 2, 12:03 PM
F174335294: D59015.diff
Fri, Oct 2, 12:03 PM
Unknown Object (File)
Thu, Oct 1, 9:54 PM
Unknown Object (File)
Thu, Oct 1, 9:19 PM
Unknown Object (File)
Tue, Sep 29, 6:38 PM
Unknown Object (File)
Sun, Sep 27, 5:23 PM
Unknown Object (File)
Sun, Sep 27, 5:22 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 Not Applicable
Unit
Tests Not Applicable