mirror_iproute2/lib
Hangbin Liu 86bf43c7c2 lib/libnetlink: update rtnl_talk to support malloc buff at run time
This is an update for 460c03f3f3 ("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>
2017-10-26 12:29:29 +02:00
..
bpf.c bpf: properly output json for xdp 2017-09-22 10:07:15 -07:00
color.c color: Rename enum 2017-10-16 09:24:11 -07:00
coverity_model.c scrub out whitespace issues 2016-03-27 10:50:14 -07:00
dnet_ntop.c scrub out whitespace issues 2016-03-27 10:50:14 -07:00
dnet_pton.c dnet: fix strict aliasing warnings 2010-07-23 12:30:48 -07:00
exec.c move cmd_exec to lib utils 2016-12-13 10:20:16 -08:00
fs.c Convert the obvious cases to strlcpy() 2017-09-01 12:10:54 -07:00
inet_proto.c Convert the obvious cases to strlcpy() 2017-09-01 12:10:54 -07:00
ipx_ntop.c scrub out whitespace issues 2016-03-27 10:50:14 -07:00
ipx_pton.c utils: provide get_hex to read a hex digit from a char 2016-06-08 09:30:41 -07:00
json_print.c lib: json_print: rework 'new_json_obj' drop FILE* argument 2017-09-29 10:10:47 -07:00
json_writer.c json_writer: add new json handlers (null, float with format, lluint, hu) 2017-08-17 18:02:40 -07:00
libgenl.c lib/libnetlink: update rtnl_talk to support malloc buff at run time 2017-10-26 12:29:29 +02:00
libnetlink.c lib/libnetlink: update rtnl_talk to support malloc buff at run time 2017-10-26 12:29:29 +02:00
ll_addr.c remove duplicated #include's 2017-07-18 17:17:15 -07:00
ll_map.c lib/ll_map: Choose size of new cache items at run-time 2017-08-24 14:53:14 -07:00
ll_proto.c remove duplicated #include's 2017-07-18 17:17:15 -07:00
ll_types.c remove duplicated #include's 2017-07-18 17:17:15 -07:00
Makefile json: move json printer to common library 2017-09-22 10:06:43 -07:00
mpls_ntop.c ip: mpls: fix printing of mpls labels 2017-05-11 11:08:02 -07:00
mpls_pton.c ip: add support for more MPLS labels 2017-05-22 11:03:02 -07:00
names.c Replace malloc && memset by calloc 2016-07-20 12:05:24 -07:00
namespace.c lib/namespace: fix fd leakage in non-error case 2015-08-19 16:32:56 -07:00
rt_names.c lib/rt_names: Drop dead code in rtnl_rttable_n2a() 2017-08-21 17:12:21 -07:00
utils.c utils: add print_escape_buf to format and print arbitrary bytes 2017-10-11 11:04:47 -07:00