opnsense-src/tests/sys
Kajetan Staszkiewicz 65c3186301 pf: Add prefer-ipv6-nexthop option for route-to pools
Now that pf is aware of address family of each pool address and source
tracking uses distinct address family for source and redirection
adddresses it is possible to add a new pool option prefer-ipv6-nexthop
which enables routing of IPv4 packets over IPv6 next hops for rules
with the route-to option.

Add a pool option flag PF_POOL_IPV6NH, apply it to pools with a keyword
prefer-ipv6-nexthop.

Modify pf_map_addr() to handle pools with addresses of different
families. Use *naf as a hint about what address family the forwarded
packet is, then pick from the pool addresses of family that can be used
as a next hop for the forwarded packet, controlled by the PF_POOL_IPV6NH
flag. For NAT pools this flag is never set and thus pf_map_addr()
will return an IP address of the same family as the forwarded packet.
For route-to pools when the flag is enabled IPv6 addresses can be
returned or IPv4 packets.

In pf_route() check rt_af, it is not guaranteed to be AF_INET anymore
because pf_map_addr() could have changed it (as *naf).

Add tests for behaviour of pf_map_addr() both with PF_POOL_IPV6NH and
without, for single IP addresses, prefixes and subnets.

Reviewed by:	kp
Sponsored by:	InnoGames GmbH
Differential Revision:	https://reviews.freebsd.org/D50781
2025-08-29 09:58:40 +02:00
..
acl Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
aio aio_kqueue_test: Fix CID 1558429 2025-01-09 08:42:36 -06:00
audit Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
auditpipe Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
cam ctl: delete dead code in the tests 2025-07-22 16:55:40 -06:00
capsicum capsicum tests: Serialize functional tests 2024-09-04 14:28:28 +00:00
cddl zfsd: don't try to fix an OFFLINE condition 2025-08-04 10:00:52 -06:00
common vnet tests: verify that we can load if_epair and if_bridge 2024-07-23 15:57:25 +02:00
compat32 Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
devrandom Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
fifo Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
file tests: Adapt existing tests for O_CLOEXEC to O_CLOFORK 2025-07-06 23:08:46 +00:00
fs fusefs: Fix a warning in a test 2025-08-17 11:13:42 -06:00
geom ggate tests: Use unique ports among tests 2024-09-04 14:28:28 +00:00
kern tests: Add some regression tests for copy_file_range() 2025-08-12 21:45:24 +00:00
kqueue tests/kqueue: repair flaky test 2025-06-24 15:29:03 -07:00
mac tests/mac_portacl: enable is_exclusive for now 2025-07-26 04:55:01 +08:00
mqueue Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
net tun(4)/tap(4): allow devices to be configured as transient 2025-08-21 09:22:44 -05:00
netgraph ng_ksocket: Add tests for IPv6 2025-06-25 12:12:11 +02:00
netinet fibs_test: Mark same_ip_multiple_ifaces_fib0 as expected to fail 2025-06-26 21:27:57 +00:00
netinet6 netinet6: allow binding a raw socket to an anycast address 2025-07-15 06:12:45 +01:00
netipsec tests: fix test for NULL encription 2025-03-25 10:23:40 +03:00
netlink netlink: Move static arrays of parsers into tests that use them 2025-04-11 09:52:39 -04:00
netmap netmap: Disable a buggy and unsafe test (sync_kloop_conflict) 2025-03-06 13:22:25 -05:00
netpfil pf: Add prefer-ipv6-nexthop option for route-to pools 2025-08-29 09:58:40 +02:00
opencrypto Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
pjdfstest Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
posixshm shm: Respect PROT_MAX when creating private mappings 2024-10-04 15:56:34 +00:00
ses
sound sound tests: Fetch HWBUF_RATE and SWBUF_RATE in sndstat_nv 2025-04-26 12:06:52 +02:00
sys queue(3): Add a test for STAILQ_REVERSE() 2025-05-07 14:34:39 +02:00
vfs Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
vm tests: move some files to the tests package 2025-05-05 16:39:25 +01:00
vmm vmm tests: Check for /dev/vmmctl to decide if vmm is initialized 2025-02-08 16:05:37 +00:00
Makefile ctl: add some ATF tests for READ BUFFER 2024-09-04 14:38:12 +00:00
Makefile.depend
Makefile.inc Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00