summaryrefslogtreecommitdiff
path: root/src/timesync
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2023-04-13 18:02:48 +0900
committerYu Watanabe <watanabe.yu+github@gmail.com>2023-04-16 13:26:58 +0900
commit789f5c6f706383442d85a9aedc6396a1a7877057 (patch)
tree3f1518f0b952ebfb72de2f1ec4669f84f050bdd8 /src/timesync
parent4836f4c67d040f51b7d1aa45b73553eb0da26097 (diff)
downloadsystemd-789f5c6f706383442d85a9aedc6396a1a7877057.tar.gz
tree-wide: copy timestamp data from cmsg
On RISCV32, time_t is 64bit and size_t is 32bit, hence the timestamp data in message header may not be aligned. Fixes #27241.
Diffstat (limited to 'src/timesync')
-rw-r--r--src/timesync/timesyncd-manager.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/timesync/timesyncd-manager.c b/src/timesync/timesyncd-manager.c
index e024fa9715..569389b9d4 100644
--- a/src/timesync/timesyncd-manager.c
+++ b/src/timesync/timesyncd-manager.c
@@ -446,7 +446,7 @@ static int manager_receive_response(sd_event_source *source, int fd, uint32_t re
return 0;
}
- recv_time = CMSG_FIND_DATA(&msghdr, SOL_SOCKET, SCM_TIMESTAMPNS, struct timespec);
+ recv_time = CMSG_FIND_AND_COPY_DATA(&msghdr, SOL_SOCKET, SCM_TIMESTAMPNS, struct timespec);
if (!recv_time)
return log_error_errno(SYNTHETIC_ERRNO(EINVAL), "Packet timestamp missing.");