diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2023-04-13 18:02:48 +0900 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2023-04-16 13:26:58 +0900 |
commit | 789f5c6f706383442d85a9aedc6396a1a7877057 (patch) | |
tree | 3f1518f0b952ebfb72de2f1ec4669f84f050bdd8 /src/timesync | |
parent | 4836f4c67d040f51b7d1aa45b73553eb0da26097 (diff) | |
download | systemd-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.c | 2 |
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."); |