[Bug 268717] [pf] rdr rules don't work for traffic originating at localhost

From: <bugzilla-noreply_at_freebsd.org>
Date: Tue, 24 Jan 2023 13:22:57 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=268717

--- Comment #14 from dfr@rabson.org ---
For my use-case, I need to be able to change both destination address and port
and currently the nat rule only allows changing the address. Also, I'm not sure
that nat will work here since it re-writes the source address and I need to
change the destination address.

As I understand the current situation with rdr, for new local connections, a
PF_IN event is triggered when the packet leaves the local network stack and
this matches the rdr rule, re-writing destination address and port and setting
a state to match the reply. Unfortunately for reply packets no corresponding
PF_OUT event is triggered when the packet is delivered to the local network
stack so the reverse re-write does not happen. This is why my suggested change
works since it simulates the PF_OUT event for packets which will be processed
locally.

-- 
You are receiving this mail because:
You are the assignee for the bug.