]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
pfring: various build issues
authorVictor Julien <victor@inliniac.net>
Tue, 21 Nov 2017 17:22:12 +0000 (18:22 +0100)
committerVictor Julien <victor@inliniac.net>
Thu, 23 Nov 2017 06:14:16 +0000 (07:14 +0100)
pfring.h brings a different version of likely/unlikely that gives
warnings. So make sure we include our own before.

Make sure pfring.h isn't included globally due to apparent redefinition
of pthread_rwlock_t.

src/decode.h
src/runmode-pfring.c
src/source-pfring.c
src/source-pfring.h
src/suricata-common.h

index d3d5b21a9296829d1f67511b4c548571f72b35b6..7205ea94dc467e6435c56ffbd00a9713f6bc371b 100644 (file)
@@ -69,7 +69,9 @@ enum PktSrcEnum {
 #include "source-af-packet.h"
 #include "source-mpipe.h"
 #include "source-netmap.h"
+#ifdef HAVE_PF_RING_FLOW_OFFLOAD
 #include "source-pfring.h"
+#endif
 
 #include "action-globals.h"
 
@@ -462,7 +464,9 @@ typedef struct Packet_
         NetmapPacketVars netmap_v;
 #endif
 #ifdef HAVE_PFRING
+#ifdef HAVE_PF_RING_FLOW_OFFLOAD
         PfringPacketVars pfring_v;
+#endif
 #endif
 
         /** libpcap vars: shared by Pcap Live mode and Pcap File mode */
index 1a1683dc562ad98c8ce992ebea01b3d172e6fed7..ef0b490abaec5432862e3a543037b079519e36b3 100644 (file)
 #include "util-runmodes.h"
 #include "util-device.h"
 
+#ifdef HAVE_PFRING
+#include <pfring.h>
+#endif
+
 static const char *default_mode_autofp = NULL;
 
 
index b423778c73516d219e96e25059a2fec0892a15b2..4eb9f793380ed32e0a59e0429b4757742006e222 100644 (file)
  * \todo Allow ring options such as snaplen etc, to be user configurable.
  */
 
-#ifdef HAVE_PFRING
-#include <pfring.h>
-#endif /* HAVE_PFRING */
-
 #include "suricata-common.h"
 #include "suricata.h"
 #include "conf.h"
@@ -119,6 +115,8 @@ TmEcode NoPfringSupportExit(ThreadVars *tv, const void *initdata, void **data)
 
 #else /* implied we do have PF_RING support */
 
+#include <pfring.h>
+
 /** protect pfring_set_bpf_filter, as it is not thread safe */
 static SCMutex pfring_bpf_set_filter_lock = SCMUTEX_INITIALIZER;
 
@@ -578,7 +576,7 @@ TmEcode ReceivePfringThreadInit(ThreadVars *tv, const void *initdata, void **dat
     } else if (strncmp(ptv->interface, "zc", 2) == 0) {
         SCLogInfo("ZC interface detected, not adding thread to cluster");
     } else {
-        ptv->ctype = pfconf->ctype;
+        ptv->ctype = (cluster_type)pfconf->ctype;
         rc = pfring_set_cluster(ptv->pd, ptv->cluster_id, ptv->ctype);
 
         if (rc != 0) {
index dc4535556d56ec0429086c92c2fac2651cba7ea0..da173cea794049d4161b6865b7a285e17b8909ec 100644 (file)
@@ -27,9 +27,6 @@
 #define PFRING_IFACE_NAME_LENGTH 48
 
 #include <config.h>
-#ifdef HAVE_PFRING
-#include <pfring.h>
-#endif
 
 typedef struct PfringThreadVars_ PfringThreadVars;
 
@@ -43,9 +40,8 @@ typedef struct PfringIfaceConfig_
 
     /* cluster param */
     int cluster_id;
-#ifdef HAVE_PFRING
-    cluster_type ctype;
-#endif
+    unsigned int ctype;
+
     char iface[PFRING_IFACE_NAME_LENGTH];
     /* number of threads */
     int threads;
index ec34a8c6cea2191a0befee183c501f3d0f7b409b..31c3993652bb06c1feebfb2e4474bc99156c0b84 100644 (file)
@@ -419,6 +419,7 @@ typedef enum {
     LOGGER_SIZE,
 } LoggerId;
 
+#include "util-optimize.h"
 #include <htp/htp.h>
 #include "threads.h"
 #include "tm-threads-common.h"
@@ -426,7 +427,6 @@ typedef enum {
 #include "util-error.h"
 #include "util-mem.h"
 #include "detect-engine-alert.h"
-#include "util-optimize.h"
 #include "util-path.h"
 #include "util-conf.h"