Compare commits

..

No commits in common. "88a0417a6b4ad2d16231f08ee659218c81540bd1" and "374fecde09a993559772c66c14c74ba461a3667e" have entirely different histories.

1 changed files with 2 additions and 5 deletions

View File

@ -72,9 +72,6 @@
#ifndef SO_TIMESTAMPING #ifndef SO_TIMESTAMPING
#define SO_TIMESTAMPING 37 #define SO_TIMESTAMPING 37
#endif #endif
#ifndef SCM_TIMESTAMPING
#define SCM_TIMESTAMPING SO_TIMESTAMPING
#endif
#define TIMESTAMPSZ 50 /* string 'absolute with date' requires max 49 bytes */ #define TIMESTAMPSZ 50 /* string 'absolute with date' requires max 49 bytes */
@ -810,13 +807,13 @@ int main(int argc, char **argv)
for (cmsg = CMSG_FIRSTHDR(&msg); for (cmsg = CMSG_FIRSTHDR(&msg);
cmsg && (cmsg->cmsg_level == SOL_SOCKET); cmsg && (cmsg->cmsg_level == SOL_SOCKET);
cmsg = CMSG_NXTHDR(&msg,cmsg)) { cmsg = CMSG_NXTHDR(&msg,cmsg)) {
if (cmsg->cmsg_type == SCM_TIMESTAMP) { if (cmsg->cmsg_type == SO_TIMESTAMP) {
struct timeval tv; struct timeval tv;
memcpy(&tv, CMSG_DATA(cmsg), sizeof(tv)); memcpy(&tv, CMSG_DATA(cmsg), sizeof(tv));
ts.tv_sec = tv.tv_sec; ts.tv_sec = tv.tv_sec;
ts.tv_nsec = tv.tv_usec; ts.tv_nsec = tv.tv_usec;
ts.tv_nsec *= 1000; ts.tv_nsec *= 1000;
} else if (cmsg->cmsg_type == SCM_TIMESTAMPING) { } else if (cmsg->cmsg_type == SO_TIMESTAMPING) {
struct timespec *stamp = (struct timespec *)CMSG_DATA(cmsg); struct timespec *stamp = (struct timespec *)CMSG_DATA(cmsg);
/* /*