Page MenuHomeFreeBSD

D57287.1795396498.diff
No OneTemporary

Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None

D57287.1795396498.diff

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

Mime Type
text/plain
Expires
Mon, Nov 23, 1:14 AM (11 h, 47 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
41919700
Default Alt Text
D57287.1795396498.diff (1 KB)

Event Timeline