mirror of
https://github.com/linux-can/can-utils.git
synced 2026-08-05 06:20:00 +02:00
Fix style and add reference to timestamps struct offset.
This commit is contained in:
@@ -713,11 +713,13 @@ int main(int argc, char **argv)
|
|||||||
|
|
||||||
struct timespec *stamp = (struct timespec *)CMSG_DATA(cmsg);
|
struct timespec *stamp = (struct timespec *)CMSG_DATA(cmsg);
|
||||||
|
|
||||||
stamp += 2;
|
// stamp[0] is the software timestamp
|
||||||
tv.tv_sec = stamp->tv_sec;
|
// stamp[1] is deprecated
|
||||||
tv.tv_usec = stamp->tv_nsec/1000;
|
// stamp[2] is the raw hardware timestamp
|
||||||
}
|
// See 2.1.2 in doc/Documentation/networking/timestamping.txt
|
||||||
else if (cmsg->cmsg_type == SO_RXQ_OVFL)
|
tv.tv_sec = stamp[2].tv_sec;
|
||||||
|
tv.tv_usec = stamp[2].tv_nsec/1000;
|
||||||
|
} else if (cmsg->cmsg_type == SO_RXQ_OVFL)
|
||||||
memcpy(&dropcnt[i], CMSG_DATA(cmsg), sizeof(__u32));
|
memcpy(&dropcnt[i], CMSG_DATA(cmsg), sizeof(__u32));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user