mirror of git://sourceware.org/git/glibc.git
linux: Use the expected size for SO_TIMESTAMP{NS} convertion
Kernel returns 32-bit values for COMPAT_SO_TIMESTAMP{NS}_OLD, not 64-bit values. Checked on x86_64-linux-gnu and i686-linux-gnu.
This commit is contained in:
parent
4b93a93e40
commit
f7de21498d
|
@ -44,7 +44,8 @@ __convert_scm_timestamps (struct msghdr *msg, socklen_t msgsize)
|
||||||
'struct __kernel_sock_timeval' while for SO_TIMESTAMPNS_NEW is a
|
'struct __kernel_sock_timeval' while for SO_TIMESTAMPNS_NEW is a
|
||||||
'struct __kernel_timespec'. In either case it is two uint64_t
|
'struct __kernel_timespec'. In either case it is two uint64_t
|
||||||
members. */
|
members. */
|
||||||
uint64_t tvts[2];
|
int64_t tvts[2];
|
||||||
|
int32_t tmp[2];
|
||||||
|
|
||||||
struct cmsghdr *cmsg, *last = NULL;
|
struct cmsghdr *cmsg, *last = NULL;
|
||||||
int type = 0;
|
int type = 0;
|
||||||
|
@ -69,7 +70,9 @@ __convert_scm_timestamps (struct msghdr *msg, socklen_t msgsize)
|
||||||
|
|
||||||
/* fallthrough */
|
/* fallthrough */
|
||||||
common:
|
common:
|
||||||
memcpy (tvts, CMSG_DATA (cmsg), sizeof (tvts));
|
memcpy (tmp, CMSG_DATA (cmsg), sizeof (tmp));
|
||||||
|
tvts[0] = tmp[0];
|
||||||
|
tvts[1] = tmp[1];
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue