From c938dbde27eb99bf19195e9ab2ae266d874f7468 Mon Sep 17 00:00:00 2001 From: Eric Leblond Date: Tue, 11 Jun 2019 22:05:34 +0200 Subject: [PATCH] util-ebpf: early exit if no map --- src/util-ebpf.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/util-ebpf.c b/src/util-ebpf.c index 59f434a4cf..e4d4e45d64 100644 --- a/src/util-ebpf.c +++ b/src/util-ebpf.c @@ -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;