pf: make af-to less magical
Contributed by Peter N. M. Hansteen on from the raising my family dept.
On our favorite operating system and its siblings, that special case has been handled via the af-to option and special case rules since back in the OpenBSD 5.1 days.
But that special case has always felt a bit awkward to some, and now David Gwynne (dlg@) is airing a patch on tech@ with a view to making af-to "less magical".
In the message titled pf: make af-to less magical, David explains the motivation,
List: openbsd-tech Subject: pf: make af-to less magical From: David Gwynne <david () gwynne ! id ! au> Date: 2026-01-16 2:11:57 Message-ID: aWmebWvdwBi6z98j () animata ! net i only recently figured out that af-to is very special in pf, but i dont think it should be. currently af-to has the following restrictions: 1. it only works for incoming packets, ie, you can only use it on "pass in" rules in pf. 2. it forces the translated packet to be forwarded. a consequence of these, and 2 in particular, is that only one state is created for an af-to connection over the firewall. this is unlike other forwarded connections where there's generally two states created, one when the packet comes in from the wire into the stack, and another when the packet goes out from the stack to the wire.

