util/ebpf: fix deprecation warning

The function bpf_program__title has been deprecated in favor of
bpf_program__section_name.
pull/6059/head
Eric Leblond 5 years ago committed by Victor Julien
parent b9351339a2
commit d477d3a878

@ -1820,6 +1820,7 @@
if test "$have_xdp" = "yes"; then
AC_DEFINE([HAVE_PACKET_XDP],[1],[XDP support is available])
fi
AC_CHECK_FUNCS(bpf_program__section_name)
fi;
# Check for DAG support.

@ -365,7 +365,11 @@ int EBPFLoadFile(const char *iface, const char *path, const char * section,
/* Let's check that our section is here */
bpf_object__for_each_program(bpfprog, bpfobj) {
#ifdef HAVE_BPF_PROGRAM__SECTION_NAME
const char *title = bpf_program__section_name(bpfprog);
#else
const char *title = bpf_program__title(bpfprog, 0);
#endif
if (!strcmp(title, section)) {
if (config->flags & EBPF_SOCKET_FILTER) {
bpf_program__set_socket_filter(bpfprog);

Loading…
Cancel
Save