From: Remi Gacogne Date: Thu, 6 Dec 2018 14:54:44 +0000 (+0100) Subject: dnsdist: Check that SO_ATTACH_BPF is defined before enabling eBPF X-Git-Tag: auth-4.2.0-alpha1~1^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F7267%2Fhead;p=thirdparty%2Fpdns.git dnsdist: Check that SO_ATTACH_BPF is defined before enabling eBPF It turns out that RH decided to backport only the tracing subsystem part of eBPF as a "Technology Preview" in the RHEL / Centos 7.6 kernel, so most of the eBPF stuff is present but not what is needed to use the networking parts. --- diff --git a/m4/pdns_with_ebpf.m4 b/m4/pdns_with_ebpf.m4 index af7a9cf9cf..760bd65510 100644 --- a/m4/pdns_with_ebpf.m4 +++ b/m4/pdns_with_ebpf.m4 @@ -20,12 +20,19 @@ AC_DEFUN([PDNS_WITH_EBPF],[ AM_CONDITIONAL([HAVE_EBPF], [test x"$bpf_headers" = "xyes" ]) AS_IF([test x"$bpf_headers" = "xyes" ], [AC_CHECK_DECL(BPF_FUNC_tail_call, - [ AC_DEFINE([HAVE_EBPF], [1], [Define if using eBPF.]) ], + [ AC_CHECK_DECL(SO_ATTACH_BPF, + [ AC_DEFINE([HAVE_EBPF], [1], [Define if using eBPF.]) ], + [ AS_IF([test "x$with_ebpf" = "xyes"], [ + AC_MSG_ERROR([EBPF support requested but SO_ATTACH_BPF not found]) + ])], + [#include + ] + )], [ AS_IF([test "x$with_ebpf" = "xyes"], [ - AC_MSG_ERROR([EBPF support requested but BPF_FUNC_tail_call not found in the eBPF headers]) - ]) - ], - [#include ] + AC_MSG_ERROR([EBPF support requested but BPF_FUNC_tail_call not found in the eBPF headers]) + ])], + [#include + ] )] ) ])