From: Kai Ruhnau Date: Wed, 15 Jun 2016 10:33:24 +0000 (+0200) Subject: socket-util: Run the fallback when the kernel complains about the null buffer (#3541) X-Git-Tag: v231~155 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=77d4acf332abd24025f31455f492fa83d97cb2e1;p=thirdparty%2Fsystemd.git 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 --- diff --git a/src/basic/socket-util.c b/src/basic/socket-util.c index 2aa4daca49b..385c3e4df33 100644 --- a/src/basic/socket-util.c +++ b/src/basic/socket-util.c @@ -986,7 +986,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;