2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-29 21:47:59 +00:00

3412. [bug] Copy timeval structure from control message data.

[RT #31548]
This commit is contained in:
Mark Andrews 2012-11-01 11:16:59 +11:00
parent fcd7c22fdf
commit 4d30dd89f5
2 changed files with 9 additions and 4 deletions

View File

@ -1,3 +1,6 @@
3412. [bug] Copy timeval structure from control message data.
[RT #31548]
3411. [tuning] Use IPV6_USE_MIN_MTU or equivalent with TCP in addition
to UDP. [RT #31690]

View File

@ -1223,7 +1223,7 @@ process_cmsg(isc__socket_t *sock, struct msghdr *msg, isc_socketevent_t *dev) {
struct in6_pktinfo *pktinfop;
#endif
#ifdef SO_TIMESTAMP
struct timeval *timevalp;
void *timevalp;
#endif
#endif
@ -1290,9 +1290,11 @@ process_cmsg(isc__socket_t *sock, struct msghdr *msg, isc_socketevent_t *dev) {
#ifdef SO_TIMESTAMP
if (cmsgp->cmsg_level == SOL_SOCKET
&& cmsgp->cmsg_type == SCM_TIMESTAMP) {
timevalp = (struct timeval *)CMSG_DATA(cmsgp);
dev->timestamp.seconds = timevalp->tv_sec;
dev->timestamp.nanoseconds = timevalp->tv_usec * 1000;
struct timeval tv;
timevalp = CMSG_DATA(cmsgp);
memcpy(&tv, timevalp, sizeof(tv));
dev->timestamp.seconds = tv.tv_sec;
dev->timestamp.nanoseconds = tv.tv_usec * 1000;
dev->attributes |= ISC_SOCKEVENTATTR_TIMESTAMP;
goto next;
}