netinet6 tests: accept an RA on an interface without /64 address

Excercise the code introduced in 9e792f7ef7
("sys/netinet6: Fix SLAAC for interfaces with no /64 LL address").

Sponsored by:	Rubicon Communications, LLC ("Netgate")
This commit is contained in:
Kristof Provost
2025-10-02 13:47:33 +02:00
parent f9fc93690a
commit c23b64fba9
+39
View File
@@ -188,9 +188,48 @@ ndp_slaac_default_route_cleanup() {
vnet_cleanup
}
atf_test_case "ndp_prefix_len_mismatch" "cleanup"
ndp_prefix_len_mismatch_head() {
atf_set descr 'Test RAs on an interface without a /64 lladdr'
atf_set require.user root
atf_set require.progs python3 scapy
}
ndp_prefix_len_mismatch_body() {
vnet_init
epair=$(vnet_mkepair)
vnet_mkjail alcatraz ${epair}a
jexec alcatraz ifconfig ${epair}a inet6 -auto_linklocal
jexec alcatraz ifconfig ${epair}a inet6 -ifdisabled
jexec alcatraz ifconfig ${epair}a inet6 accept_rtadv
jexec alcatraz ifconfig ${epair}a inet6 fe80::5a9c:fcff:fe10:5d07/127
jexec alcatraz ifconfig ${epair}a up
ifconfig ${epair}b inet6 -ifdisabled
ifconfig ${epair}b up
atf_check -e ignore python3 $(atf_get_srcdir)/ra.py \
--sendif ${epair}b \
--dst $(ndp_if_lladdr ${epair}a alcatraz) \
--src $(ndp_if_lladdr ${epair}b) \
--prefix "2001:db8:ffff:1000::" --prefixlen 64
atf_check \
-o match:"inet6 2001:db8:ffff:1000:.* prefixlen 64.*autoconf.*" \
jexec alcatraz ifconfig ${epair}a
}
ndp_prefix_len_mismatch_cleanup() {
vnet_cleanup
}
atf_init_test_cases()
{
atf_add_test_case "ndp_add_gu_success"
atf_add_test_case "ndp_del_gu_success"
atf_add_test_case "ndp_slaac_default_route"
atf_add_test_case "ndp_prefix_len_mismatch"
}