Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F163358855
D57287.id178773.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
D57287.id178773.diff
View Options
Index: ping/tests/ping_test.sh
===================================================================
--- ping/tests/ping_test.sh
+++ ping/tests/ping_test.sh
@@ -253,14 +253,22 @@
ifconfig `cat tun.txt` destroy
}
-atf_test_case timestamp_origin
+atf_test_case timestamp_origin cleanup
timestamp_origin_head()
{
atf_set "descr" "ICMP Originate Timestamp"
+ atf_set "require.user" "root"
+ atf_set "require.config" "allow_sysctl_side_effects"
}
timestamp_origin_body()
{
require_ipv4
+ # The kernel only replies to ICMP timestamp requests when
+ # net.inet.icmp.tstamprepl is enabled. Save the current value
+ # so the cleanup hook can restore it, then enable replies.
+ sysctl -n net.inet.icmp.tstamprepl > tstamprepl.txt
+ sysctl net.inet.icmp.tstamprepl=1
+
# Run ping timestamp
out=$(ping -Mt -c1 127.0.0.1)
@@ -286,6 +294,12 @@
atf_fail "tso ($tso) differs from tsr ($tsr) by $diff seconds"
fi
}
+timestamp_origin_cleanup()
+{
+ if [ -f tstamprepl.txt ]; then
+ sysctl net.inet.icmp.tstamprepl=`cat tstamprepl.txt`
+ fi
+}
atf_init_test_cases()
{
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Jul 23, 11:57 AM (14 h, 12 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
35401167
Default Alt Text
D57287.id178773.diff (1 KB)
Attached To
Mode
D57287: ping: fix test timestamp_origin when tstamprepl is disabled
Attached
Detach File
Event Timeline
Log In to Comment