opnsense-src/tests/sys/netinet
Olivier Cochard cf3f8e3dc6 carp: fix global demotion counter to VRRP advertisements
When net.inet.carp.preempt=1 and a physical interface goes down, the global
V_carp_demotion counter is incremented. For CARP this was already reflected in
outgoing advertisements via DEMOTE_ADVSKEW(), but VRRP sent the raw
sc_vrrp_prio unchanged, so demotion had no effect.

Add DEMOTE_VRRP_PRIO(), a macro analogous to DEMOTE_ADVSKEW():
It subtracts V_carp_demotion from the configured priority and clamps the result
to [0, 254]. Priority 0 is VRRPv3's "resign" signal and causes backups to
preempt immediately. Priority 255 (IP address owner) is never demoted.

Reviewed by:	kp
Approved by:	kp
Sponsored by:	Netflix
Differential Revision:	https://reviews.freebsd.org/D55558

(cherry picked from commit 9f71153aec0cb455cd49af6d4ca7e4c16fd45d7a)
2026-11-10 12:51:01 +01: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 carp: fix global demotion counter to VRRP advertisements 2026-11-10 12:51:01 +01: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
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