From: Tom Gundersen Date: Fri, 6 Feb 2015 13:43:17 +0000 (+0100) Subject: sd-rtnl: don't treat 0-length messages specially X-Git-Tag: v219~119 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=commitdiff_plain;h=b8719ebb57961f93a9aeeb49f0b9ba1f2bab7068 sd-rtnl: don't treat 0-length messages specially Still parse the CMSG data, and most importantly make sure we drop the message when peeking. --- diff --git a/src/libsystemd/sd-rtnl/rtnl-message.c b/src/libsystemd/sd-rtnl/rtnl-message.c index f07289943..14a52dfae 100644 --- a/src/libsystemd/sd-rtnl/rtnl-message.c +++ b/src/libsystemd/sd-rtnl/rtnl-message.c @@ -1350,10 +1350,6 @@ 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? */ - log_warning("rtnl: ignoring empty message"); - return 0; } for (cmsg = CMSG_FIRSTHDR(&msg); cmsg; cmsg = CMSG_NXTHDR(&msg, cmsg)) {