dcavalca / rpms / systemd

Forked from rpms/systemd 3 months ago
Clone
Blob Blame History Raw
From 5968b1c304188e466759b8ba419fc10f150e5541 Mon Sep 17 00:00:00 2001
From: Tom Gundersen <teg@jklm.no>
Date: Thu, 28 Aug 2014 15:59:13 +0200
Subject: [PATCH] sd-rtnl: log if kernel buffer is overrun as we currently
 can't handle that case

---
 src/libsystemd/sd-rtnl/rtnl-message.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/libsystemd/sd-rtnl/rtnl-message.c b/src/libsystemd/sd-rtnl/rtnl-message.c
index 1f596ca10c..906a9de1c0 100644
--- a/src/libsystemd/sd-rtnl/rtnl-message.c
+++ b/src/libsystemd/sd-rtnl/rtnl-message.c
@@ -1132,10 +1132,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;