|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
From 5968b1c304188e466759b8ba419fc10f150e5541 Mon Sep 17 00:00:00 2001
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
From: Tom Gundersen <teg@jklm.no>
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
Date: Thu, 28 Aug 2014 15:59:13 +0200
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
Subject: [PATCH] sd-rtnl: log if kernel buffer is overrun as we currently
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
can't handle that case
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
---
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
src/libsystemd/sd-rtnl/rtnl-message.c | 7 +++++--
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
1 file changed, 5 insertions(+), 2 deletions(-)
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
diff --git a/src/libsystemd/sd-rtnl/rtnl-message.c b/src/libsystemd/sd-rtnl/rtnl-message.c
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
index 1f596ca10c..906a9de1c0 100644
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
--- a/src/libsystemd/sd-rtnl/rtnl-message.c
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+++ b/src/libsystemd/sd-rtnl/rtnl-message.c
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
@@ -1132,10 +1132,13 @@ static int socket_recv_message(int fd, struct iovec *iov, uint32_t *_group, bool
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
assert(iov);
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
r = recvmsg(fd, &msg, MSG_TRUNC | (peek ? MSG_PEEK : 0));
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
- if (r < 0)
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ if (r < 0) {
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
/* no data */
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ if (errno == ENOBUFS)
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ log_debug("rtnl: kernel receive buffer overrun");
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
return (errno == EAGAIN) ? 0 : -errno;
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
- else if (r == 0)
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ } else if (r == 0)
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
/* connection was closed by the kernel */
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
return -ECONNRESET;
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
|