[PATCH] Increase the size of the netlink recvmsg buffer

dwilder <[email protected]>
Newsgroups gmane.linux.keepalived.devel
Message-ID <[email protected]>
On systems with a large number of network interfaces keepalived may 
report:
"Netlink: error: message truncated messages"
<and>
"VRRP is trying to assign VIP to unknown qr-dc4f0313-ca interface !!! go 
out
  and fix your conf !!!"

This was reported on a system running OpenStack/Nutron.

I found that the netlink recvmsg buffer was too small causing messages 
to be
truncated. Increasing the buffer from 4K to 8K prevents the problem.
(linux/netlink.h suggests using an 8K buffer).

I tested the fix by creating 100 veth interfaces and verifying the 
errors
did not return.

Signed-off-by: David Wilder <[email protected]>

---
  keepalived/vrrp/vrrp_netlink.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/keepalived/vrrp/vrrp_netlink.c 
b/keepalived/vrrp/vrrp_netlink.c
index d7adffa..7897b4c 100644
--- a/keepalived/vrrp/vrrp_netlink.c
+++ b/keepalived/vrrp/vrrp_netlink.c
@@ -273,7 +273,7 @@ netlink_parse_info(int (*filter) (struct sockaddr_nl 
*, struct nlmsghdr *),
  	int error;

  	while (1) {
-		char buf[4096];
+		char buf[8192];
  		struct iovec iov = { buf, sizeof buf };
  		struct sockaddr_nl snl;
  		struct msghdr msg =
-- 
1.8.3.1


------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.