]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
util-ebpf: more useful error message
authorEric Leblond <eric@regit.org>
Tue, 4 Jun 2019 11:49:32 +0000 (13:49 +0200)
committerVictor Julien <victor@inliniac.net>
Tue, 18 Jun 2019 05:07:02 +0000 (07:07 +0200)
At the time of the writing, libbpf output useful error message
on strdout only and errno is not really interesting. So let's
tell user to look at stdout.

src/util-ebpf.c

index eb68c158e1c7f6f6cb665aa20d441a5fbffda488..c14e82546a272874b8e18467aa446318b37fbf81 100644 (file)
@@ -387,11 +387,9 @@ int EBPFLoadFile(const char *iface, const char *path, const char * section,
     err = bpf_object__load(bpfobj);
     if (err < 0) {
         if (err == -EPERM) {
-            SCLogError(SC_ERR_MEM_ALLOC,
-                    "Permission issue when loading eBPF object: "
-                    "%s (%d)",
-                    strerror(err),
-                    err);
+            SCLogError(SC_ERR_SYSCALL,
+                    "Permission issue when loading eBPF object"
+                    " (check libbpf error on stdout)");
         } else {
             char buf[129];
             libbpf_strerror(err, buf, sizeof(buf));