Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F111650763
D21220.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
586 B
Referenced Files
None
Subscribers
None
D21220.diff
View Options
Index: sbin/ping6/ping6.c
===================================================================
--- sbin/ping6/ping6.c
+++ sbin/ping6/ping6.c
@@ -1379,8 +1379,12 @@
struct tv32 *tv32;
(void)gettimeofday(&tv, NULL);
tv32 = (struct tv32 *)&outpack[ICMP6ECHOLEN];
- tv32->tv32_sec = htonl(tv.tv_sec);
- tv32->tv32_usec = htonl(tv.tv_usec);
+ /*
+ * The time values saved in a packet are
+ * truncated down to 32 bits.
+ */
+ tv32->tv32_sec = (uint32_t)htonl(tv.tv_sec);
+ tv32->tv32_usec = (uint32_t)htonl(tv.tv_usec);
}
cc = ICMP6ECHOLEN + datalen;
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Mar 7, 12:47 PM (20 h, 30 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
17032513
Default Alt Text
D21220.diff (586 B)
Attached To
Mode
D21220: ping6: Annotate truncating of time values saved in a packet
Attached
Detach File
Event Timeline
Log In to Comment