pfring: various build issues

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.
pull/3009/head
Victor Julien 9 years ago
parent b6baafb3e3
commit 6ce45bcf38

@ -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 */

@ -30,6 +30,10 @@
#include "util-runmodes.h"
#include "util-device.h"
#ifdef HAVE_PFRING
#include <pfring.h>
#endif
static const char *default_mode_autofp = NULL;

@ -28,10 +28,6 @@
* \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) {

@ -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;

@ -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"

Loading…
Cancel
Save