Actions
Bug #6275
openfail af_xdp at configure time when libxdp is missing?
Affected Versions:
Effort:
Difficulty:
Label:
Description
af_xdp is enabled by default in configure.ac, when libxdp is missing, the configure script continues without error, and make succeeds, but when starting suricata with --af-xdp mode, suricata failed with error about system not supporting af_xdp. configure script should fail if libxdp is missing? should af_xdp enabled by default? here is my workaround to successfully detect if libxdp is missing and fail configure script when libxdp is missing, I also disabled af_xdp by default
diff --git a/configure.ac b/configure.ac index 0b71278fc..2c197576b 100644 --- a/configure.ac +++ b/configure.ac @@ -1357,7 +1357,7 @@ # AF_XDP support AC_ARG_ENABLE(af-xdp, AS_HELP_STRING([--disable-af-xdp], [Disable AF_XDP support [default=enabled]]), - [enable_af_xdp=$enableval],[enable_af_xdp=yes]) + [enable_af_xdp=$enableval],[enable_af_xdp=no]) AS_IF([test "x$enable_af_xdp" = "xyes"], [ # Check for the availability of elf @@ -1366,13 +1366,13 @@ # Conditionally check headers, only when found will it 'continue' AS_IF([test "x$enable_af_xdp" = "xyes"], # Check for the availability of libxdp - AC_CHECK_HEADERS([xdp/xsk.h],,[enable_af_xdp=no]) - AC_CHECK_LIB([xdp],[xsk_umem__create],,[enable_af_xdp=no])) + AC_CHECK_HEADERS([xdp/xsk.h],,[enable_af_xdp=no])) AS_IF([test "x$enable_af_xdp" = "xyes"], # Check for the availability of libbpf AC_CHECK_HEADERS([bpf/libbpf.h],,[enable_af_xdp=no]) - AC_CHECK_LIB([bpf],[bpf_object__open],,[enable_af_xdp=no])) + AC_CHECK_LIB([bpf],[bpf_object__open],,[enable_af_xdp=no]), + AC_MSG_ERROR([libxdp not found]))
Actions