aboutsummaryrefslogtreecommitdiffstats
path: root/net/compat.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/compat.c')
-rw-r--r--net/compat.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/net/compat.c b/net/compat.c
index 0e407563ae85..9a0f5f2b90c8 100644
--- a/net/compat.c
+++ b/net/compat.c
@@ -215,6 +215,7 @@ Efault:
215int put_cmsg_compat(struct msghdr *kmsg, int level, int type, int len, void *data) 215int put_cmsg_compat(struct msghdr *kmsg, int level, int type, int len, void *data)
216{ 216{
217 struct compat_timeval ctv; 217 struct compat_timeval ctv;
218 struct compat_timespec cts;
218 struct compat_cmsghdr __user *cm = (struct compat_cmsghdr __user *) kmsg->msg_control; 219 struct compat_cmsghdr __user *cm = (struct compat_cmsghdr __user *) kmsg->msg_control;
219 struct compat_cmsghdr cmhdr; 220 struct compat_cmsghdr cmhdr;
220 int cmlen; 221 int cmlen;
@@ -229,7 +230,14 @@ int put_cmsg_compat(struct msghdr *kmsg, int level, int type, int len, void *dat
229 ctv.tv_sec = tv->tv_sec; 230 ctv.tv_sec = tv->tv_sec;
230 ctv.tv_usec = tv->tv_usec; 231 ctv.tv_usec = tv->tv_usec;
231 data = &ctv; 232 data = &ctv;
232 len = sizeof(struct compat_timeval); 233 len = sizeof(ctv);
234 }
235 if (level == SOL_SOCKET && type == SO_TIMESTAMPNS) {
236 struct timespec *ts = (struct timespec *)data;
237 cts.tv_sec = ts->tv_sec;
238 cts.tv_nsec = ts->tv_nsec;
239 data = &cts;
240 len = sizeof(cts);
233 } 241 }
234 242
235 cmlen = CMSG_COMPAT_LEN(len); 243 cmlen = CMSG_COMPAT_LEN(len);