Project

General

Profile

Actions

Support #3052

closed

util-ebpf.c compile error

Added by Leif Tishendorf almost 5 years ago. Updated almost 5 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Affected Versions:
Label:

Description

System is Ubuntu 18.04.2 using kernel 4.18.0-22-generic.

compiled and installed the latest libbpf headers from git repo.

While trying to compile the latest git repo of suricata I get the following error:

  CC       util-ebpf.o
util-ebpf.c:359:13: error: implicit declaration of function 'bpf_program__set_ifindex' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
            bpf_program__set_ifindex(bpfprog, ifindex);
            ^
util-ebpf.c:359:13: warning: this function declaration is not a prototype [-Wstrict-prototypes]
util-ebpf.c:362:13: error: implicit declaration of function 'bpf_map__set_ifindex' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
            bpf_map__set_ifindex(map, ifindex);
            ^
util-ebpf.c:362:13: note: did you mean 'bpf_map__set_priv'?
/usr/local/include/bpf/libbpf.h:244:5: note: 'bpf_map__set_priv' declared here
int bpf_map__set_priv(struct bpf_map *map, void *priv,
    ^
util-ebpf.c:362:13: warning: this function declaration is not a prototype [-Wstrict-prototypes]
            bpf_map__set_ifindex(map, ifindex);
            ^
2 warnings and 2 errors generated.
Makefile:1752: recipe for target 'util-ebpf.o' failed

Config string is:

CC=clang ./configure --prefix=/usr/ --sysconfdir=/etc/ --localstatedir=/var/ --with-libnss-libraries=/usr/lib --with-libnss-includes=/usr/include/nss/ --with-libnspr-libraries=/usr/lib --with-libnspr-includes=/usr/include/nspr --enable-geoip --enable-luajit --enable-rust --enable-ebpf --enable-ebpf-build
Actions #1

Updated by Victor Julien almost 5 years ago

What is the version / revision of the installed libbpf?

Actions #2

Updated by Leif Tishendorf almost 5 years ago

Victor Julien wrote:

What is the version / revision of the installed libbpf?

ldd /usr/bin/suricata | grep libbpf
        libbpf.so.0 => /usr/lib64/libbpf.so.0 (0x00007fede6173000)

Jun 19 09:28 /usr/lib64/libbpf.so.0 -> libbpf.so.0.0.3

I pulled from git repo yesterday. Let me know if that's not the information you are looking for.

Actions #3

Updated by Victor Julien almost 5 years ago

Is it possible that there would also be an older libbpf.h on the system?

Actions #4

Updated by Leif Tishendorf almost 5 years ago

Victor Julien wrote:

Is it possible that there would also be an older libbpf.h on the system?

That was indeed the issue. Corrected and compiled fine.

Thank you.

Actions #5

Updated by Victor Julien almost 5 years ago

  • Tracker changed from Bug to Support
  • Status changed from New to Closed

Glad it was solved!

Actions

Also available in: Atom PDF