Module Name: src
Committed By: njoly
Date: Tue Jun 16 15:56:10 UTC 2009
Modified Files:
src/sys/compat/linux/common: linux_socket.c
Log Message:
Make compat linux sendmsg/recvmsg output msghdr and control messages
buffers with ktrace(1), just like the native functions.
To generate a diff of this commit:
cvs rdiff -u -r1.100 -r1.101 src/sys/compat/linux/common/linux_socket.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/compat/linux/common/linux_socket.c
diff -u src/sys/compat/linux/common/linux_socket.c:1.100 src/sys/compat/linux/common/linux_socket.c:1.101
--- src/sys/compat/linux/common/linux_socket.c:1.100 Thu Jun 11 19:57:58 2009
+++ src/sys/compat/linux/common/linux_socket.c Tue Jun 16 15:56:10 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: linux_socket.c,v 1.100 2009/06/11 19:57:58 njoly Exp $ */
+/* $NetBSD: linux_socket.c,v 1.101 2009/06/16 15:56:10 njoly Exp $ */
/*-
* Copyright (c) 1995, 1998, 2008 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux_socket.c,v 1.100 2009/06/11 19:57:58 njoly Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_socket.c,v 1.101 2009/06/16 15:56:10 njoly Exp $");
#if defined(_KERNEL_OPT)
#include "opt_inet.h"
@@ -541,6 +541,9 @@
msg.msg_control = ctl_mbuf;
msg.msg_flags |= MSG_CONTROLMBUF;
+
+ ktrkuser("msgcontrol", mtod(ctl_mbuf, void *),
+ msg.msg_controllen);
}
error = do_sys_sendmsg(l, SCARG(uap, s), &msg, bflags, retval);
@@ -601,6 +604,8 @@
return 0;
}
+ ktrkuser("msgcontrol", mtod(control, void *), mp->msg_controllen);
+
q = (char *)mp->msg_control;
q_end = q + mp->msg_controllen;
@@ -725,8 +730,10 @@
if (msg.msg_flags < 0)
/* Some flag unsupported by Linux */
error = EINVAL;
- else
+ else {
+ ktrkuser("msghdr", &msg, sizeof(msg));
error = copyout(&msg, SCARG(uap, msg), sizeof(msg));
+ }
}
return (error);