naccyde / rpms / iproute

Forked from rpms/iproute 10 months ago
Clone

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

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