Use CMSG_LEN() to compute ping SCM_TIMESTAMP cmsg_len.

Without this, cmsg_len size should be smaller than necessary on alpha.
(Though, no obvious error was seen on ping time value on beast.)
This commit is contained in:
Yoshinobu Inoue 2000-03-14 17:37:19 +00:00
parent 5949020620
commit 6ecbec7768
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=58068

View File

@ -649,7 +649,7 @@ main(argc, argv)
#ifdef SO_TIMESTAMP
if (cmsg->cmsg_level == SOL_SOCKET &&
cmsg->cmsg_type == SCM_TIMESTAMP &&
cmsg->cmsg_len == (sizeof *cmsg + sizeof *t)) {
cmsg->cmsg_len == CMSG_LEN(sizeof *t)) {
/* Copy to avoid alignment problems: */
memcpy(&now,CMSG_DATA(cmsg),sizeof(now));
t = &now;