Fix style and add reference to timestamps struct offset.

pull/59/head
Fabián Inostroza 2017-12-02 16:43:52 -03:00
parent 3195717961
commit eeb0dc2390
1 changed files with 7 additions and 5 deletions

View File

@ -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));
} }