naccyde / rpms / iproute

Forked from rpms/iproute 9 months ago
Clone

Blame SOURCES/0021-iplink-double-the-buffer-size-also-in-iplink_get.patch

36cfb7
From c560900fc16eeac064cc7c43a96c5343fe68ae76 Mon Sep 17 00:00:00 2001
36cfb7
From: Hangbin Liu <haliu@redhat.com>
36cfb7
Date: Wed, 8 Nov 2017 14:39:11 +0800
36cfb7
Subject: [PATCH] iplink: double the buffer size also in iplink_get()
36cfb7
36cfb7
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1380803
36cfb7
Upstream Status: iproute2.git commit 460c03f3f3cc
36cfb7
36cfb7
commit 460c03f3f3cc436ff4673d75722ba68a6ec9343d
36cfb7
Author: Michal Kubecek <mkubecek@suse.cz>
36cfb7
Date:   Fri Sep 1 18:39:16 2017 +0200
36cfb7
36cfb7
    iplink: double the buffer size also in iplink_get()
36cfb7
36cfb7
    Commit 72b365e8e0fd ("libnetlink: Double the dump buffer size") increased
36cfb7
    the buffer size for "ip link show" command to 32 KB to handle NICs with
36cfb7
    large number of VFs. With "dev" filter, a different code path is taken and
36cfb7
    iplink_get() still uses only 16 KB buffer.
36cfb7
36cfb7
    The size of 32768 is not very future-proof as NICs supporting 120-128 VFs
36cfb7
    are already in use so that single RTM_NEWLINK message in the dump can
36cfb7
    exceed 30000 bytes. But it's what rtnl_talk() and rtnl_dump_filter_l() use
36cfb7
    so let's be consistent. Once this proves insufficient, all three sizes
36cfb7
    should be increased.
36cfb7
36cfb7
    Signed-off-by: Michal Kubecek <mkubecek@suse.cz>
36cfb7
36cfb7
Signed-off-by: Hangbin Liu <haliu@redhat.com>
36cfb7
---
36cfb7
 ip/iplink.c | 2 +-
36cfb7
 1 file changed, 1 insertion(+), 1 deletion(-)
36cfb7
36cfb7
diff --git a/ip/iplink.c b/ip/iplink.c
36cfb7
index 2b2421f..5afbadf 100644
36cfb7
--- a/ip/iplink.c
36cfb7
+++ b/ip/iplink.c
36cfb7
@@ -1015,7 +1015,7 @@ int iplink_get(unsigned int flags, char *name, __u32 filt_mask)
36cfb7
 	};
36cfb7
 	struct {
36cfb7
 		struct nlmsghdr n;
36cfb7
-		char buf[16384];
36cfb7
+		char buf[32768];
36cfb7
 	} answer;
36cfb7
 
36cfb7
 	if (name) {
36cfb7
-- 
36cfb7
1.8.3.1
36cfb7