]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
dnsdist: Disable eBPF support when BPF_FUNC_tail_call is not found 4067/head
authorRemi Gacogne <remi.gacogne@powerdns.com>
Fri, 8 Jul 2016 08:42:11 +0000 (10:42 +0200)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Fri, 8 Jul 2016 08:42:53 +0000 (10:42 +0200)
m4/pdns_with_ebpf.m4

index 54c04854a80e07d80be0df78830e849194db64fa..af7a9cf9cfeb582ee285d7f7ba15d8d755476b9f 100644 (file)
@@ -18,5 +18,14 @@ AC_DEFUN([PDNS_WITH_EBPF],[
     ])
   ])
   AM_CONDITIONAL([HAVE_EBPF], [test x"$bpf_headers" = "xyes" ])
-  AS_IF([test x"$bpf_headers" = "xyes" ], [AC_DEFINE([HAVE_EBPF], [1], [Define if using eBPF.])])
+  AS_IF([test x"$bpf_headers" = "xyes" ],
+    [AC_CHECK_DECL(BPF_FUNC_tail_call,
+      [ AC_DEFINE([HAVE_EBPF], [1], [Define if using eBPF.]) ],
+      [ 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 <linux/bpf.h>]
+    )]
+  )
 ])