chiark / gitweb /
sd-rtnl: don't assign to unused variable
[elogind.git] / src / libsystemd / sd-rtnl / rtnl-message.c
index 1f596ca10cdc6cf80f7d409bd7ca1c5c7fad0ba1..30e33584c4ac649cac0a833707b62dad00d6825e 100644 (file)
@@ -531,7 +531,6 @@ static int add_rtattr(sd_rtnl_message *m, unsigned short type, const void *data,
                 /* if no data was passed, make sure we still initialize the padding
                    note that we can have data_length > 0 (used by some containers) */
                 padding = RTA_DATA(rta);
-                data_length = 0;
         }
 
         /* make sure also the padding at the end of the message is initialized */
@@ -1132,10 +1131,13 @@ static int socket_recv_message(int fd, struct iovec *iov, uint32_t *_group, bool
         assert(iov);
 
         r = recvmsg(fd, &msg, MSG_TRUNC | (peek ? MSG_PEEK : 0));
-        if (r < 0)
+        if (r < 0) {
                 /* no data */
+                if (errno == ENOBUFS)
+                        log_debug("rtnl: kernel receive buffer overrun");
+
                 return (errno == EAGAIN) ? 0 : -errno;
-        else if (r == 0)
+        else if (r == 0)
                 /* connection was closed by the kernel */
                 return -ECONNRESET;