]> git.baikalelectronics.ru Git - kernel.git/commit
libbpf: Use pr_warn() when printing netlink errors
authorToke Høiland-Jørgensen <toke@redhat.com>
Sat, 9 Nov 2019 20:37:30 +0000 (21:37 +0100)
committerAlexei Starovoitov <ast@kernel.org>
Mon, 11 Nov 2019 03:26:30 +0000 (19:26 -0800)
commit703c7e6744ec3e58ce0520ddba6943a6491ae477
treee4113e360fc202b4c7e663f28fa8e6c661c025e9
parent9fd3db0c2d4b2b1bbee03c1eaa6fe24a4b13e1f1
libbpf: Use pr_warn() when printing netlink errors

The netlink functions were using fprintf(stderr, ) directly to print out
error messages, instead of going through the usual logging macros. This
makes it impossible for the calling application to silence or redirect
those error messages. Fix this by switching to pr_warn() in nlattr.c and
netlink.c.

Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Andrii Nakryiko <andriin@fb.com>
Acked-by: David S. Miller <davem@davemloft.net>
Acked-by: Song Liu <songliubraving@fb.com>
Link: https://lore.kernel.org/bpf/157333185055.88376.15999360127117901443.stgit@toke.dk
tools/lib/bpf/netlink.c
tools/lib/bpf/nlattr.c