aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/unix/sysv/linux/convert_scm_timestamps.c
diff options
context:
space:
mode:
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>2022-01-12 10:35:06 -0300
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>2022-01-12 10:35:06 -0300
commit572e0c855495bfbcd2323584a243430e6b7c8bb3 (patch)
treecb52ce53b26fe6a5801d60371296cbe217bcf9ab /sysdeps/unix/sysv/linux/convert_scm_timestamps.c
parent5bd83aa836d9ce5d16a6e148f5a280ddf2dd3aa5 (diff)
downloadglibc-572e0c855495bfbcd2323584a243430e6b7c8bb3.tar
glibc-572e0c855495bfbcd2323584a243430e6b7c8bb3.tar.gz
glibc-572e0c855495bfbcd2323584a243430e6b7c8bb3.tar.bz2
glibc-572e0c855495bfbcd2323584a243430e6b7c8bb3.zip
Revert "linux: Fix ancillary 64-bit time timestamp conversion (BZ #28349, BZ #28350)"
This reverts commit 21e0f45c7d73df6fe30c77ffcc9f81410e2ee369.
Diffstat (limited to 'sysdeps/unix/sysv/linux/convert_scm_timestamps.c')
-rw-r--r--sysdeps/unix/sysv/linux/convert_scm_timestamps.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/sysdeps/unix/sysv/linux/convert_scm_timestamps.c b/sysdeps/unix/sysv/linux/convert_scm_timestamps.c
index ebf83de948..580eb4be84 100644
--- a/sysdeps/unix/sysv/linux/convert_scm_timestamps.c
+++ b/sysdeps/unix/sysv/linux/convert_scm_timestamps.c
@@ -54,8 +54,6 @@ __convert_scm_timestamps (struct msghdr *msg, socklen_t msgsize)
cmsg != NULL;
cmsg = CMSG_NXTHDR (msg, cmsg))
{
- last = cmsg;
-
if (cmsg->cmsg_level != SOL_SOCKET)
continue;
@@ -77,6 +75,8 @@ __convert_scm_timestamps (struct msghdr *msg, socklen_t msgsize)
tvts[1] = tmp[1];
break;
}
+
+ last = cmsg;
}
if (last == NULL || type == 0)
@@ -88,11 +88,10 @@ __convert_scm_timestamps (struct msghdr *msg, socklen_t msgsize)
return;
}
- /* Zero memory for the new cmsghdr, required by CMSG_NXTHDR. */
- memset (msg->msg_control + msg->msg_controllen, 0,
- CMSG_SPACE (sizeof tvts));
msg->msg_controllen += CMSG_SPACE (sizeof tvts);
- cmsg = CMSG_NXTHDR (msg, last);
+ cmsg = CMSG_NXTHDR(msg, last);
+ if (cmsg == NULL)
+ return;
cmsg->cmsg_level = SOL_SOCKET;
cmsg->cmsg_type = type;
cmsg->cmsg_len = CMSG_LEN (sizeof tvts);