From: Eric Leblond Date: Tue, 11 Jun 2019 20:05:34 +0000 (+0200) Subject: util-ebpf: early exit if no map X-Git-Tag: suricata-5.0.0-rc1~288 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c938dbde27eb99bf19195e9ab2ae266d874f7468;p=thirdparty%2Fsuricata.git util-ebpf: early exit if no map --- 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;