summaryrefslogtreecommitdiffstats
path: root/net/compat.c
diff options
context:
space:
mode:
authorDeepa Dinamani <deepa.kernel@gmail.com>2019-02-02 10:34:48 -0500
committerDavid S. Miller <davem@davemloft.net>2019-02-03 14:17:30 -0500
commit13c6ee2a921683bae4bb4ba57b1f5b82f49e6b8a (patch)
tree6603af04975126384041dacb4d094d58e6de7b6b /net/compat.c
parentbcb3fc3247e5a7ceb467ca0cfdaa4c1b830dd8f9 (diff)
socket: Use old_timeval types for socket timestamps
As part of y2038 solution, all internal uses of struct timeval are replaced by struct __kernel_old_timeval and struct compat_timeval by struct old_timeval32. Make socket timestamps use these new types. This is mainly to be able to verify that the kernel build is y2038 safe when such non y2038 safe types are not supported anymore. Signed-off-by: Deepa Dinamani <deepa.kernel@gmail.com> Acked-by: Willem de Bruijn <willemb@google.com> Cc: isdn@linux-pingi.de Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/compat.c')
-rw-r--r--net/compat.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/net/compat.c b/net/compat.c
index ccf93cd0e49b..9629f053d4fa 100644
--- a/net/compat.c
+++ b/net/compat.c
@@ -209,8 +209,8 @@ int put_cmsg_compat(struct msghdr *kmsg, int level, int type, int len, void *dat
209{ 209{
210 struct compat_cmsghdr __user *cm = (struct compat_cmsghdr __user *) kmsg->msg_control; 210 struct compat_cmsghdr __user *cm = (struct compat_cmsghdr __user *) kmsg->msg_control;
211 struct compat_cmsghdr cmhdr; 211 struct compat_cmsghdr cmhdr;
212 struct compat_timeval ctv; 212 struct old_timeval32 ctv;
213 struct compat_timespec cts[3]; 213 struct old_timespec32 cts[3];
214 int cmlen; 214 int cmlen;
215 215
216 if (cm == NULL || kmsg->msg_controllen < sizeof(*cm)) { 216 if (cm == NULL || kmsg->msg_controllen < sizeof(*cm)) {
@@ -220,7 +220,7 @@ int put_cmsg_compat(struct msghdr *kmsg, int level, int type, int len, void *dat
220 220
221 if (!COMPAT_USE_64BIT_TIME) { 221 if (!COMPAT_USE_64BIT_TIME) {
222 if (level == SOL_SOCKET && type == SO_TIMESTAMP_OLD) { 222 if (level == SOL_SOCKET && type == SO_TIMESTAMP_OLD) {
223 struct timeval *tv = (struct timeval *)data; 223 struct __kernel_old_timeval *tv = (struct __kernel_old_timeval *)data;
224 ctv.tv_sec = tv->tv_sec; 224 ctv.tv_sec = tv->tv_sec;
225 ctv.tv_usec = tv->tv_usec; 225 ctv.tv_usec = tv->tv_usec;
226 data = &ctv; 226 data = &ctv;