summaryrefslogtreecommitdiff
path: root/sys/compat
diff options
context:
space:
mode:
Diffstat (limited to 'sys/compat')
-rw-r--r--sys/compat/linux/linux_socket.c4
-rw-r--r--sys/compat/linux/linux_socket.h5
2 files changed, 6 insertions, 3 deletions
diff --git a/sys/compat/linux/linux_socket.c b/sys/compat/linux/linux_socket.c
index d17d67811e0..4f1ab4ea55b 100644
--- a/sys/compat/linux/linux_socket.c
+++ b/sys/compat/linux/linux_socket.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: linux_socket.c,v 1.44 2012/04/22 05:43:14 guenther Exp $ */
+/* $OpenBSD: linux_socket.c,v 1.45 2012/06/19 11:28:20 pirofti Exp $ */
/* $NetBSD: linux_socket.c,v 1.14 1996/04/05 00:01:50 christos Exp $ */
/*
@@ -245,7 +245,7 @@ linux_socket(p, v, retval)
return error;
SCARG(&bsa, protocol) = lsa.protocol;
- SCARG(&bsa, type) = lsa.type;
+ SCARG(&bsa, type) = lsa.type & LINUX_SOCKET_TYPE_MASK;
SCARG(&bsa, domain) = linux_to_bsd_domain(lsa.domain);
if (SCARG(&bsa, domain) == -1)
return EINVAL;
diff --git a/sys/compat/linux/linux_socket.h b/sys/compat/linux/linux_socket.h
index 1d22cec0299..98ff2d950ec 100644
--- a/sys/compat/linux/linux_socket.h
+++ b/sys/compat/linux/linux_socket.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: linux_socket.h,v 1.9 2011/12/03 12:38:30 fgsch Exp $ */
+/* $OpenBSD: linux_socket.h,v 1.10 2012/06/19 11:28:20 pirofti Exp $ */
/* $NetBSD: linux_socket.h,v 1.3 1995/05/28 10:16:34 mycroft Exp $ */
/*
@@ -120,6 +120,9 @@
#define LINUX_MSG_WAITALL 0x100
#define LINUX_MSG_NOSIGNAL 0x4000
+/* Mask out extra type-related options */
+#define LINUX_SOCKET_TYPE_MASK 0xf
+
struct linux_sockaddr {
unsigned short sa_family;
char sa_data[14];