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)
commitb6e99b010ecf829fd8453a7a77e389501bb81990
treee4113e360fc202b4c7e663f28fa8e6c661c025e9
parent4f33ddb4e3e28ade924fbf05ec8bcd7d5c022fee
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