Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F159937878
D56759.id177005.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
731 B
Referenced Files
None
Subscribers
None
D56759.id177005.diff
View Options
Index: sbin/ping/ping.c
===================================================================
--- sbin/ping/ping.c
+++ sbin/ping/ping.c
@@ -1029,9 +1029,16 @@
*/
tv32.tv32_sec = (uint32_t)htonl(now.tv_sec);
tv32.tv32_nsec = (uint32_t)htonl(now.tv_nsec);
- if (options & F_TIME)
+ if (options & F_TIME) {
+ /*
+ * However, per RFC 792 the Originate Timestamp (otime)
+ * should be milliseconds since midnight UTC. Something,
+ * that CLOCK_MONOTONIC does not guarantee.
+ */
+ (void)clock_gettime(CLOCK_REALTIME, &now);
icp.icmp_otime = htonl((now.tv_sec % (24*60*60))
* 1000 + now.tv_nsec / 1000000);
+ }
if (timing)
bcopy((void *)&tv32,
(void *)&outpack[ICMP_MINLEN + phdr_len],
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Jun 20, 6:06 PM (10 h, 49 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
34124036
Default Alt Text
D56759.id177005.diff (731 B)
Attached To
Mode
D56759: ping: use CLOCK_REALTIME for ICMP Originate Timestamp
Attached
Detach File
Event Timeline
Log In to Comment