Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

y2038: socket: remove timespec reference in timestamping

In order to remove the 'struct timespec' definition and the
timespec64_to_timespec() helper function, change over the in-kernel
definition of 'struct scm_timestamping' to use the __kernel_old_timespec
replacement and open-code the assignment.

Acked-by: Deepa Dinamani <deepa.kernel@gmail.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>

+11 -2
+7
include/uapi/linux/errqueue.h
··· 37 37 * The timestamping interfaces SO_TIMESTAMPING, MSG_TSTAMP_* 38 38 * communicate network timestamps by passing this struct in a cmsg with 39 39 * recvmsg(). See Documentation/networking/timestamping.txt for details. 40 + * User space sees a timespec definition that matches either 41 + * __kernel_timespec or __kernel_old_timespec, in the kernel we 42 + * require two structure definitions to provide both. 40 43 */ 41 44 struct scm_timestamping { 45 + #ifdef __KERNEL__ 46 + struct __kernel_old_timespec ts[3]; 47 + #else 42 48 struct timespec ts[3]; 49 + #endif 43 50 }; 44 51 45 52 struct scm_timestamping64 {
+4 -2
net/core/scm.c
··· 268 268 struct scm_timestamping tss; 269 269 int i; 270 270 271 - for (i = 0; i < ARRAY_SIZE(tss.ts); i++) 272 - tss.ts[i] = timespec64_to_timespec(tss_internal->ts[i]); 271 + for (i = 0; i < ARRAY_SIZE(tss.ts); i++) { 272 + tss.ts[i].tv_sec = tss_internal->ts[i].tv_sec; 273 + tss.ts[i].tv_nsec = tss_internal->ts[i].tv_nsec; 274 + } 273 275 274 276 put_cmsg(msg, SOL_SOCKET, SO_TIMESTAMPING_OLD, sizeof(tss), &tss); 275 277 }