From 8e672b6af770c75a69b1a026cbfef7f1ff6e598c Mon Sep 17 00:00:00 2001 From: Kai Ruhnau Date: Wed, 15 Jun 2016 12:33:24 +0200 Subject: [PATCH] socket-util: Run the fallback when the kernel complains about the null buffer (#3541) Calling recv with a NULL buffer returns EFAULT instead of EOPNOTSUPP on older kernels (3.14). Fixes #3407 Signed-off-by: Kai Ruhnau --- src/basic/socket-util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/basic/socket-util.c b/src/basic/socket-util.c index 86d6e3f6e..f47a8f04e 100644 --- a/src/basic/socket-util.c +++ b/src/basic/socket-util.c @@ -991,7 +991,7 @@ ssize_t next_datagram_size_fd(int fd) { l = recv(fd, NULL, 0, MSG_PEEK|MSG_TRUNC); if (l < 0) { - if (errno == EOPNOTSUPP) + if (errno == EOPNOTSUPP || errno == EFAULT) goto fallback; return -errno; -- 2.30.2