]> git.proxmox.com Git - mirror_iproute2.git/commit - tc/tc_class.c
lib/libnetlink: update rtnl_talk to support malloc buff at run time
authorHangbin Liu <liuhangbin@gmail.com>
Thu, 26 Oct 2017 01:41:47 +0000 (09:41 +0800)
committerStephen Hemminger <sthemmin@microsoft.com>
Thu, 26 Oct 2017 10:29:29 +0000 (12:29 +0200)
commit86bf43c7c2fdc33d7c021b4a1add1c8facbca51c
tree909726c8933492238dd6e41138e40e641deb44c0
parent2d34851cd341f0e1b3fc17ca3e6e874229f3a1f8
lib/libnetlink: update rtnl_talk to support malloc buff at run time

This is an update for 460c03f3f3cc ("iplink: double the buffer size also in
iplink_get()"). After update, we will not need to double the buffer size
every time when VFs number increased.

With call like rtnl_talk(&rth, &req.n, NULL, 0), we can simply remove the
length parameter.

With call like rtnl_talk(&rth, nlh, nlh, sizeof(req), I add a new variable
answer to avoid overwrite data in nlh, because it may has more info after
nlh. also this will avoid nlh buffer not enough issue.

We need to free answer after using.

Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
Signed-off-by: Phil Sutter <phil@nwl.cc>
37 files changed:
bridge/fdb.c
bridge/link.c
bridge/mdb.c
bridge/vlan.c
genl/ctrl.c
include/libnetlink.h
ip/ipaddress.c
ip/ipaddrlabel.c
ip/ipfou.c
ip/ipila.c
ip/ipl2tp.c
ip/iplink.c
ip/iplink_vrf.c
ip/ipmacsec.c
ip/ipneigh.c
ip/ipnetns.c
ip/ipntable.c
ip/iproute.c
ip/iprule.c
ip/ipseg6.c
ip/iptoken.c
ip/link_gre.c
ip/link_gre6.c
ip/link_ip6tnl.c
ip/link_iptnl.c
ip/link_vti.c
ip/link_vti6.c
ip/tcp_metrics.c
ip/xfrm_policy.c
ip/xfrm_state.c
lib/libgenl.c
lib/libnetlink.c
misc/ss.c
tc/m_action.c
tc/tc_class.c
tc/tc_filter.c
tc/tc_qdisc.c