Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F141930232
D54321.id168461.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D54321.id168461.diff
View Options
diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c
--- a/sys/netpfil/pf/pf.c
+++ b/sys/netpfil/pf/pf.c
@@ -11178,10 +11178,12 @@
}
action = pf_test_state_icmp(&s, &pd, &reason);
if (action == PF_PASS || action == PF_AFRT) {
- if (V_pfsync_update_state_ptr != NULL)
- V_pfsync_update_state_ptr(s);
- r = s->rule;
- a = s->anchor;
+ if (s != NULL) {
+ if (V_pfsync_update_state_ptr != NULL)
+ V_pfsync_update_state_ptr(s);
+ r = s->rule;
+ a = s->anchor;
+ }
} else if (s == NULL)
action = pf_test_rule(&r, &s, &pd,
&a, &ruleset, &reason, inp, &match_rules);
diff --git a/tests/sys/netpfil/pf/divert-to.sh b/tests/sys/netpfil/pf/divert-to.sh
--- a/tests/sys/netpfil/pf/divert-to.sh
+++ b/tests/sys/netpfil/pf/divert-to.sh
@@ -416,8 +416,7 @@
"pass in on ${epair}b proto tcp from any to port 7 divert-to 0.0.0.0 port 1001"
reply=$(echo "foo" | nc -N 192.0.2.2 7)
- if ["${reply}" != "foo" ];
- then
+ if [ "${reply}" != "foo" ]; then
atf_fail "Did not receive echo reply"
fi
}
@@ -427,6 +426,42 @@
pft_cleanup
}
+atf_test_case "pr260867_icmp" "cleanup"
+pr260867_icmp_head()
+{
+ atf_set descr 'Variant of the PR260867 test'
+ atf_set require.user root
+}
+
+pr260867_icmp_body()
+{
+ pft_init
+ divert_init
+
+ epair=$(vnet_mkepair)
+
+ atf_check ifconfig ${epair}a 192.0.2.1/24 up
+
+ vnet_mkjail alcatraz ${epair}b
+ jexec alcatraz ifconfig ${epair}b 192.0.2.2/24 up
+
+ # Sanity check
+ atf_check -s exit:0 -o ignore ping -c3 192.0.2.2
+
+ jexec alcatraz $(atf_get_srcdir)/../common/divapp 1001 divert-back &
+
+ jexec alcatraz pfctl -e
+ pft_set_rules alcatraz \
+ "pass in on ${epair}b proto icmp from any to any divert-to 0.0.0.0 port 1001"
+
+ atf_check -o ignore ping -c 3 192.0.2.2
+}
+
+pr260867_icmp_cleanup()
+{
+ pft_cleanup
+}
+
atf_init_test_cases()
{
atf_add_test_case "in_div"
@@ -440,4 +475,5 @@
atf_add_test_case "in_dn_in_div_in_out_div_out_dn_out"
atf_add_test_case "pr260867"
+ atf_add_test_case "pr260867_icmp"
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Jan 14, 12:35 AM (2 h, 25 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
27629628
Default Alt Text
D54321.id168461.diff (1 KB)
Attached To
Mode
D54321: pf: Fix state handling when ICMP packets are diverted
Attached
Detach File
Event Timeline
Log In to Comment