opnsense-src/sbin/pfctl
Kajetan Staszkiewicz d2761422eb pf: Use different address family for source and redirection address
The function pf_map_addr() and source tracking operate on a single
address family. This made sense before introducing address family
translation. When combining af-to with route-to or with sticky-address,
the next-hop or the NAT address are of different address family than
the source address. For example in NAT64 scenaro an IPv6 source address
is translated to an IPv4 address and routed over IPv4 gateway.

Make source nodes dual-AF, that is have a separate source AF and
redirection AF. Store route AF in struct pf_kstate, export it to pfctl.
When loading rules with redirection pools with pfctl store address
family of each address. When printing states don't deduce next-hop's
address family from af-to, use the one stored in state.

Reviewed by:	kp
Approved by:	kp
Sponsored by:	InnoGames GmbH
Differential Revision:	https://reviews.freebsd.org/D51659
2025-08-01 12:11:30 +02:00
..
tests pfctl tests: verify port range validation 2025-07-15 09:55:29 +02:00
Makefile Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
Makefile.depend Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
parse.y pf: Use different address family for source and redirection address 2025-08-01 12:11:30 +02:00
pf.os Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
pf_print_state.c pf: Use different address family for source and redirection address 2025-08-01 12:11:30 +02:00
pf_ruleset.c sbin: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
pfctl.8 pfctl.8: Mention hostid and checksum 2025-07-12 11:57:52 +02:00
pfctl.c pf: Use different address family for source and redirection address 2025-08-01 12:11:30 +02:00
pfctl.h pfctl: Do the actual pfr_strerror() to pf_strerror() rename 2025-07-12 11:57:50 +02:00
pfctl_altq.c Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:42 -06:00
pfctl_ioctl.h
pfctl_optimize.c pf: rename PF_OPT_TABLE_PREFIX to PF_OPTIMIZER_TABLE_PFX 2025-07-12 11:57:52 +02:00
pfctl_osfp.c pfctl: recursively flush rules and tables 2025-07-09 10:57:50 +02:00
pfctl_parser.c pf: Use different address family for source and redirection address 2025-08-01 12:11:30 +02:00
pfctl_parser.h pf: Use different address family for source and redirection address 2025-08-01 12:11:30 +02:00
pfctl_qstats.c Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:42 -06:00
pfctl_radix.c pfctl: Unify error message for nonexisting anchors 2025-07-12 11:57:50 +02:00
pfctl_table.c pfctl: Do the actual pfr_strerror() to pf_strerror() rename 2025-07-12 11:57:50 +02:00