opnsense-src/tests/sys/netinet
Bojan Novković 65a7d0af51 bind(2): Lookup local address in current FIB if '*.bind_all_fibs' is active
When a protocol-specific 'bind_all_fibs' tunable is set to 0, a
listening socket will only receive traffic originating from the FIB
it was bound to. However, there are no checks to determine whether
an address exists in the target FIB when binding the socket, which can
lead to a situation where a socket and the address it was bound to
belong to different FIBs.

Prevent this footgun by looking up the requested address in the current
FIB if 'bind_all_fibs' is active and returning an error if the address
does not exist.

Sponsored by:	Stormshield
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D58281
Reviewed by:	glebius, pouria, markj
MFC after:	2 weeks

(cherry picked from commit 948ad32ae1e0811f45e1d38f26636fefed5051f0)
2026-09-14 07:30:53 +02:00
..
libalias tests/libalias: Add a regression test for an alias_smedia bug 2026-07-06 10:29:29 +02:00
arp.sh tests/arp: Add a 1-second tolerance 2025-04-25 23:03:21 +02:00
broadcast.c netinet/tests: Mark broadcast:INADDR_BROADCAST as needing network access 2025-06-24 01:17:01 +00:00
carp.py sys tests: Add scapy as a required program 2025-02-12 14:40:43 +00:00
carp.sh tests: carp: Update test case unicast_v4 to catch PR 284872 2025-02-23 03:26:32 +08:00
divert.sh tests: Require python3 when using Scapy 2025-03-03 07:52:33 +00:00
fib_bind.py bind(2): Lookup local address in current FIB if '*.bind_all_fibs' is active 2026-09-14 07:30:53 +02:00
fibs.sh
fibs_multibind_test.c fibs_multibind_test: Explicitly cast the checksum value 2025-02-08 16:05:37 +00:00
fibs_test.sh tests/fibs_test: unskip udp_dontroute6 testcase 2026-04-27 16:13:42 -04:00
forward.sh tests: Require python3 when using Scapy 2025-03-03 07:52:33 +00:00
igmp.py netinet tests: ensure we send IGMPv2 messages if net.inet.igmp.default_version=2 2025-05-01 09:31:21 +02:00
ip6_mrouted.c tests: Add some simple regression tests for ip_mroute 2026-09-14 07:26:27 +02:00
ip6_v4mapped_test.c
ip_mroute.py tests/ip_mroute: Remove test timeouts 2026-09-14 07:26:48 +02:00
ip_reass_test.c Decorate IPv4 structures used for byte buffer overlays as packed. 2025-05-04 13:48:04 +02:00
lpm.sh
Makefile bind(2): Lookup local address in current FIB if '*.bind_all_fibs' is active 2026-09-14 07:30:53 +02:00
Makefile.depend
multicast.sh tests/netinet: add test for IP_MULTICAST_IF 2025-03-22 16:39:50 -07:00
output.sh netinet tests: Make test jail names unique 2024-01-27 13:51:37 -05:00
redirect.py
redirect.sh tests: Require python3 when using Scapy 2025-03-03 07:52:33 +00:00
sendto-IP_MULTICAST_IF.c tests/netinet: add test for IP_MULTICAST_IF 2025-03-22 16:39:50 -07:00
so_reuseport_lb_test.c so_reuseport_lb_test: Add a test case for connected UDP sockets 2025-10-22 15:48:08 +00:00
socket_afinet.c tests/socket_afinet: Remove a conditional skip 2026-05-07 13:40:12 -07:00
tcp_connect_port_test.c
tcp_implied_connect.c tests/netinet: fix several tests that depended on connect(INADDR_ANY) 2025-05-27 17:24:59 -07:00
tcp_md5_getsockopt.c
tcp_user_cookie.c
udp_bindings.c tests/netinet: add few tests for unconnected UDP socket 2025-02-17 15:28:51 -08:00
udp_dontroute.c
udp_io.c tests/netinet: fix several tests that depended on connect(INADDR_ANY) 2025-05-27 17:24:59 -07:00