]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
util-ebpf: fix libbpf error handling
authorEric Leblond <eric@regit.org>
Sun, 7 Jan 2018 11:59:16 +0000 (12:59 +0100)
committerEric Leblond <eric@regit.org>
Tue, 6 Feb 2018 15:58:19 +0000 (16:58 +0100)
src/util-ebpf.c

index a904cb19430e567ca25c7dd4297d281c4dad3807..1fac35b907746990a16ca82346da28d95b52d56c 100644 (file)
@@ -116,9 +116,6 @@ int EBPFGetMapFDByName(const char *iface, const char *name)
     return -1;
 }
 
-#define bpf__is_error(ee) ee
-#define bpf__get_error(ee) 1
-
 /** 
  * Load a section of an eBPF file
  *
@@ -161,10 +158,10 @@ int EBPFLoadFile(const char *iface, const char *path, const char * section,
     }
 
     bpfobj = bpf_object__open(path);
-
-    if (libbpf_get_error(bpfobj)) {
+    long error = libbpf_get_error(bpfobj);
+    if (error) {
         char err_buf[128];
-        libbpf_strerror(bpf__get_error(bpfobj), err_buf,
+        libbpf_strerror(error, err_buf,
                         sizeof(err_buf));
         SCLogError(SC_ERR_INVALID_VALUE,
                    "Unable to load eBPF objects in '%s': %s",