From c408b15c516250905b25838c97f8d0d83d9cbe13 Mon Sep 17 00:00:00 2001 From: Jeff Lucovsky Date: Thu, 20 Aug 2020 11:26:33 -0400 Subject: [PATCH] napatech: Fix compiler issues w/out bypass This commit fixes compiler errors when Napatech bypass is not configured --- src/source-napatech.c | 4 ++-- src/util-napatech.c | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/source-napatech.c b/src/source-napatech.c index 0374688d91..c30a4fb213 100644 --- a/src/source-napatech.c +++ b/src/source-napatech.c @@ -679,11 +679,11 @@ static void NapatechReleasePacket(struct Packet_ *p) * If the packet is to be dropped we need to set the wirelength * before releasing the Napatech buffer back to NTService. */ +#ifdef NAPATECH_ENABLE_BYPASS if (is_inline && PACKET_TEST_ACTION(p, ACTION_DROP)) { p->ntpv.dyn3->wireLength = 0; } -#ifdef NAPATECH_ENABLE_BYPASS /* * If this flow is to be programmed for hardware bypass we do it now. This is done * here because the action is not available in the packet structure at the time of the @@ -847,11 +847,11 @@ TmEcode NapatechPacketLoop(ThreadVars *tv, void *data, void *slot) SC_ATOMIC_ADD(stream_count, 1); if (SC_ATOMIC_GET(stream_count) == NapatechGetNumConfiguredStreams()) { +#ifdef NAPATECH_ENABLE_BYPASS if (ConfGetBool("napatech.inline", &is_inline) == 0) { is_inline = 0; } -#ifdef NAPATECH_ENABLE_BYPASS /* Initialize the port map before we setup traffic filters */ for (int i = 0; i < MAX_PORTS; ++i) { inline_port_map[i] = -1; diff --git a/src/util-napatech.c b/src/util-napatech.c index fb0dda949c..4bed3bdf65 100644 --- a/src/util-napatech.c +++ b/src/util-napatech.c @@ -1385,7 +1385,9 @@ uint32_t NapatechSetupTraffic(uint32_t first_stream, uint32_t last_stream) NtConfigStream_t hconfig; char ntpl_cmd[512]; int is_inline = 0; +#ifdef NAPATECH_ENABLE_BYPASS int is_span_port[MAX_PORTS] = { 0 }; +#endif char span_ports[128]; memset(span_ports, 0, sizeof(span_ports)); -- 2.47.2