diff options
| author | Robert Watson <rwatson@FreeBSD.org> | 2007-04-14 10:35:09 +0000 |
|---|---|---|
| committer | Robert Watson <rwatson@FreeBSD.org> | 2007-04-14 10:35:09 +0000 |
| commit | d72a615878a201f13441e5bb02542e34bfe28c78 (patch) | |
| tree | 31e4fc91e53d41cf1f54d7039bbd37159948f7e6 /sys/compat/linux/linux_socket.c | |
| parent | faac60c8fcc31dcc5cbd4bd575a00cea18c42d7d (diff) | |
Notes
Diffstat (limited to 'sys/compat/linux/linux_socket.c')
| -rw-r--r-- | sys/compat/linux/linux_socket.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/sys/compat/linux/linux_socket.c b/sys/compat/linux/linux_socket.c index 9a90c574de98..553a657d42e9 100644 --- a/sys/compat/linux/linux_socket.c +++ b/sys/compat/linux/linux_socket.c @@ -1028,6 +1028,16 @@ linux_sendmsg(struct thread *td, struct linux_sendmsg_args *args) error = copyin(PTRIN(linux_args.msg), &msg, sizeof(msg)); if (error) return (error); + + /* + * Some Linux applications (ping) define a non-NULL control data + * pointer, but a msg_controllen of 0, which is not allowed in the + * FreeBSD system call interface. NULL the msg_control pointer in + * order to handle this case. This should be checked, but allows the + * Linux ping to work. + */ + if (msg.msg_control != NULL && msg.msg_controllen == 0) + msg.msg_control = NULL; error = copyiniov(msg.msg_iov, msg.msg_iovlen, &iov, EMSGSIZE); if (error) return (error); |
