]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
napatech: Fix compiler issues w/out bypass
authorJeff Lucovsky <jeff@lucovsky.org>
Thu, 20 Aug 2020 15:26:33 +0000 (11:26 -0400)
committerVictor Julien <victor@inliniac.net>
Mon, 24 Aug 2020 14:05:30 +0000 (16:05 +0200)
This commit fixes compiler errors when Napatech bypass is not configured

src/source-napatech.c
src/util-napatech.c

index 0374688d912a68f4c9b7c32ca7f11b513f29b815..c30a4fb213c3ce204b827f141891706db864646e 100644 (file)
@@ -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;
index fb0dda949c0209d11acf8d641d553b56597079c1..4bed3bdf65f23b3e8ccdef79787dc5cdbc30b9a8 100644 (file)
@@ -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));