svn commit: r339836 - head/tests/sys/netpfil/pf
Kristof Provost
kp at FreeBSD.org
Sun Oct 28 05:37:16 UTC 2018
Author: kp
Date: Sun Oct 28 05:37:15 2018
New Revision: 339836
URL: https://svnweb.freebsd.org/changeset/base/339836
Log:
pf tests: Test ':0' ignoring link-local addresses
PR: 201695
Modified:
head/tests/sys/netpfil/pf/pass_block.sh
Modified: head/tests/sys/netpfil/pf/pass_block.sh
==============================================================================
--- head/tests/sys/netpfil/pf/pass_block.sh Sun Oct 28 05:32:50 2018 (r339835)
+++ head/tests/sys/netpfil/pf/pass_block.sh Sun Oct 28 05:37:15 2018 (r339836)
@@ -84,8 +84,54 @@ v6_cleanup()
pft_cleanup
}
+atf_test_case "noalias" "cleanup"
+noalias_head()
+{
+ atf_set descr 'Test the :0 noalias option'
+ atf_set require.user root
+}
+
+noalias_body()
+{
+ pft_init
+
+ epair=$(pft_mkepair)
+ ifconfig ${epair}a inet6 2001:db8:42::1/64 up no_dad
+
+ pft_mkjail alcatraz ${epair}b
+ jexec alcatraz ifconfig ${epair}b inet6 2001:db8:42::2/64 up no_dad
+
+ linklocaladdr=$(jexec alcatraz ifconfig ${epair}b inet6 \
+ | grep %${epair}b \
+ | awk '{ print $2; }' \
+ | cut -d % -f 1)
+
+ # Sanity check
+ atf_check -s exit:0 -o ignore ping6 -c 1 -x 1 2001:db8:42::2
+ atf_check -s exit:0 -o ignore ping6 -c 1 -x 1 ${linklocaladdr}%${epair}a
+
+ jexec alcatraz pfctl -e
+ pft_set_rules alcatraz "block out inet6 from (epair0b:0) to any"
+
+ atf_check -s exit:2 -o ignore ping6 -c 1 -x 1 2001:db8:42::2
+
+ # We should still be able to ping the link-local address
+ atf_check -s exit:0 -o ignore ping6 -c 1 -x 1 ${linklocaladdr}%${epair}a
+
+ pft_set_rules alcatraz "block out inet6 from (epair0b) to any"
+
+ # We cannot ping to the link-local address
+ atf_check -s exit:2 -o ignore ping6 -c 1 -x 1 ${linklocaladdr}%${epair}a
+}
+
+noalias_cleanup()
+{
+ pft_cleanup
+}
+
atf_init_test_cases()
{
atf_add_test_case "v4"
atf_add_test_case "v6"
+ atf_add_test_case "noalias"
}
More information about the svn-src-all
mailing list