chiark / gitweb /
sd-rtnl: don't treat 0-length messages specially
authorTom Gundersen <teg@jklm.no>
Fri, 6 Feb 2015 13:43:17 +0000 (14:43 +0100)
committerTom Gundersen <teg@jklm.no>
Sun, 8 Feb 2015 15:34:27 +0000 (16:34 +0100)
Still parse the CMSG data, and most importantly make sure we drop the message when peeking.

src/libsystemd/sd-rtnl/rtnl-message.c

index f072899433ec7440f72f0c1acf9a994b461fb7ce..14a52dfae052a2128ba09d987d04904ac9435dc7 100644 (file)
@@ -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)) {