]> git.proxmox.com Git - mirror_iproute2.git/commit
lib/libnetlink: re malloc buff if size is not enough
authorHangbin Liu <liuhangbin@gmail.com>
Thu, 26 Oct 2017 01:41:46 +0000 (09:41 +0800)
committerStephen Hemminger <sthemmin@microsoft.com>
Thu, 26 Oct 2017 10:29:29 +0000 (12:29 +0200)
commit2d34851cd341f0e1b3fc17ca3e6e874229f3a1f8
tree6112add25f457f1e078d147f5e92562de5eb9683
parent66e40a4a860bf17ee1eed3f3a528210b26051450
lib/libnetlink: re malloc buff if size is not enough

With commit 72b365e8e0fd ("libnetlink: Double the dump buffer size")
we doubled the buffer size to support more VFs. But the VFs number is
increasing all the time. Some customers even use more than 200 VFs now.

We could not double it everytime when the buffer is not enough. Let's just
not hard code the buffer size and malloc the correct number when running.

Introduce function rtnl_recvmsg() to always return a newly allocated buffer.
The caller need to free it after using.

Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
Signed-off-by: Phil Sutter <phil@nwl.cc>
lib/libnetlink.c