summaryrefslogtreecommitdiff
path: root/src/libsystemd/sd-rtnl/rtnl-message.c
diff options
context:
space:
mode:
authorTom Gundersen <teg@jklm.no>2015-02-06 11:54:30 +0100
committerTom Gundersen <teg@jklm.no>2015-02-06 12:10:07 +0100
commitda53c5516e3807145a321df08b853d6f9f21c6fc (patch)
treee87ceae4c0f84d12311ad4f66cf93620374b5925 /src/libsystemd/sd-rtnl/rtnl-message.c
parentb621bfd2311a13311a45ccd5e31a9ce3214895fe (diff)
sd-rtnl: don't fall over when receiving 0 bytes from the socket
causes EOF. Seems like a kernel bug. Ignoring it seems to work be the best we can do for now... See https://bugs.freedesktop.org/show_bug.cgi?id=88397
Diffstat (limited to 'src/libsystemd/sd-rtnl/rtnl-message.c')
-rw-r--r--src/libsystemd/sd-rtnl/rtnl-message.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/libsystemd/sd-rtnl/rtnl-message.c b/src/libsystemd/sd-rtnl/rtnl-message.c
index 23253029e5..f072899433 100644
--- a/src/libsystemd/sd-rtnl/rtnl-message.c
+++ b/src/libsystemd/sd-rtnl/rtnl-message.c
@@ -1350,9 +1350,11 @@ static int socket_recv_message(int fd, struct iovec *iov, uint32_t *_group, bool
log_debug("rtnl: no data in socket");
return (errno == EAGAIN || errno == EINTR) ? 0 : -errno;
- } else if (r == 0)
- /* connection was closed by the kernel */
- return -ECONNRESET;
+ } else if (r == 0) {
+ /* connection was closed by the kernel? */
+ log_warning("rtnl: ignoring empty message");
+ return 0;
+ }
for (cmsg = CMSG_FIRSTHDR(&msg); cmsg; cmsg = CMSG_NXTHDR(&msg, cmsg)) {
if (cmsg->cmsg_level == SOL_SOCKET &&