summaryrefslogtreecommitdiffstats
path: root/src/socket_wrapper.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/socket_wrapper.c')
-rw-r--r--src/socket_wrapper.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/socket_wrapper.c b/src/socket_wrapper.c
index 0fcdb99..62e83ef 100644
--- a/src/socket_wrapper.c
+++ b/src/socket_wrapper.c
@@ -1929,6 +1929,12 @@ static int swrap_socket(int family, int type, int protocol)
struct socket_info_fd *fi;
int fd;
int real_type = type;
+
+ /*
+ * Remove possible addition flags passed to socket() so
+ * do not fail checking the type.
+ * See https://lwn.net/Articles/281965/
+ */
#ifdef SOCK_CLOEXEC
real_type &= ~SOCK_CLOEXEC;
#endif