]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
util-ebpf: early exit if no map
authorEric Leblond <eric@regit.org>
Tue, 11 Jun 2019 20:05:34 +0000 (22:05 +0200)
committerVictor Julien <victor@inliniac.net>
Tue, 18 Jun 2019 05:07:02 +0000 (07:07 +0200)
src/util-ebpf.c

index 59f434a4cf5788f75a73e17c168693dfe629d5a0..e4d4e45d644577152553b4a99380573a94ce8f3b 100644 (file)
@@ -664,6 +664,9 @@ static int EBPFForEachFlowV4Table(ThreadVars *th_v, LiveDevice *dev, const char
                                   )
 {
     int mapfd = EBPFGetMapFDByName(dev->dev, name);
+    if (mapfd == -1)
+        return -1;
+
     struct flowv4_keys key = {}, next_key;
     int found = 0;
     unsigned int i;
@@ -770,6 +773,9 @@ static int EBPFForEachFlowV6Table(ThreadVars *th_v,
                                   )
 {
     int mapfd = EBPFGetMapFDByName(dev->dev, name);
+    if (mapfd == -1)
+        return -1;
+
     struct flowv6_keys key = {}, next_key;
     int found = 0;
     unsigned int i;