Original limit was due to a specific data structure.
TmEcode DecodePfring(ThreadVars *, Packet *, void *);
TmEcode DecodePfringThreadDeinit(ThreadVars *tv, void *data);
-extern uint16_t max_pending_packets;
+extern uint32_t max_pending_packets;
#include <pfring.h>
#include "source-af-packet.h"
#include "util-bpf.h"
-extern uint16_t max_pending_packets;
+extern uint32_t max_pending_packets;
const char *RunModeAFPGetDefaultMode(void)
{
(void) SC_ATOMIC_ADD(aconf->ref, aconf->threads);
if (aconf->ring_size != 0) {
- if (aconf->ring_size * aconf->threads < max_pending_packets) {
+ if (aconf->ring_size * aconf->threads < (int)max_pending_packets) {
aconf->ring_size = max_pending_packets / aconf->threads + 1;
SCLogWarning("%s: inefficient setup: ring-size < max_pending_packets. "
"Resetting to decent value %d.",
#include "suricata.h"
#include "util-bpf.h"
-extern uint16_t max_pending_packets;
+extern uint32_t max_pending_packets;
const char *RunModeNetmapGetDefaultMode(void)
{
UtListTests(regex_arg);
} else {
/* global packet pool */
- extern uint16_t max_pending_packets;
+ extern uint32_t max_pending_packets;
max_pending_packets = 128;
PacketPoolInit();
#endif /* HAVE_AF_PACKET */
-extern uint16_t max_pending_packets;
+extern uint32_t max_pending_packets;
#ifndef HAVE_AF_PACKET
/* Number of bytes per loop to process before fetching more data. */
#define BYTES_PER_LOOP (4 * 1024 * 1024) /* 4 MB */
-extern uint16_t max_pending_packets;
+extern uint32_t max_pending_packets;
typedef struct ErfDagThreadVars_ {
ThreadVars *tv;
#define IPFW_SOCKET_POLL_MSEC 300
-extern uint16_t max_pending_packets;
+extern uint32_t max_pending_packets;
/**
* \brief Structure to hold thread specific variables.
#include <numa.h>
#include <nt.h>
-extern uint16_t max_pending_packets;
+extern uint32_t max_pending_packets;
typedef struct NapatechThreadVars_
{
#else /* we do have NFQ support */
-extern uint16_t max_pending_packets;
+extern uint32_t max_pending_packets;
#define MAX_ALREADY_TREATED 5
#define NFQ_VERDICT_RETRY_COUNT 3
#include "source-pcap-file.h"
#include "util-exception-policy.h"
-extern uint16_t max_pending_packets;
+extern uint32_t max_pending_packets;
extern PcapFileGlobalVars pcap_g;
static void PcapFileCallbackLoop(char *user, struct pcap_pkthdr *h, u_char *pkt);
#include "suricata.h"
#include "conf.h"
-extern uint16_t max_pending_packets;
+extern uint32_t max_pending_packets;
PcapFileGlobalVars pcap_g;
/**
uint8_t host_mode = SURI_HOST_IS_SNIFFER_ONLY;
/** Maximum packets to simultaneously process. */
-uint16_t max_pending_packets;
+uint32_t max_pending_packets;
/** global indicating if detection is enabled */
int g_detect_disabled = 0;
intmax_t tmp_max_pending_packets;
if (ConfGetInt("max-pending-packets", &tmp_max_pending_packets) != 1)
tmp_max_pending_packets = DEFAULT_MAX_PENDING_PACKETS;
- if (tmp_max_pending_packets < 1 || tmp_max_pending_packets >= UINT16_MAX) {
- SCLogError("Maximum max-pending-packets setting is 65534 and must be greater than 0. "
+ if (tmp_max_pending_packets < 1 || tmp_max_pending_packets > 2147483648) {
+ SCLogError("Maximum max-pending-packets setting is 2147483648 and must be greater than 0. "
"Please check %s for errors",
suri->conf_filename);
return TM_ECODE_FAILED;
} else {
- max_pending_packets = (uint16_t)tmp_max_pending_packets;
+ max_pending_packets = (uint32_t)tmp_max_pending_packets;
}
- SCLogDebug("Max pending packets set to %" PRIu16, max_pending_packets);
+ SCLogDebug("Max pending packets set to %" PRIu32, max_pending_packets);
/* Pull the default packet size from the config, if not found fall
* back on a sane default. */
tmm_modules[TMM_DECODEPCAPFILE].ThreadInit(tv, NULL, (void **) &dtv);
(void)SC_ATOMIC_SET(tv->tm_slots->slot_next->slot_data, dtv);
- extern uint16_t max_pending_packets;
+ extern uint32_t max_pending_packets;
max_pending_packets = 128;
PacketPoolInit();
SC_ATOMIC_SET(engine_stage, SURICATA_RUNTIME);
tmm_modules[TMM_FLOWWORKER].ThreadInit(&tv, NULL, &fwd);
StatsSetupPrivate(&tv);
- extern uint16_t max_pending_packets;
+ extern uint32_t max_pending_packets;
max_pending_packets = 128;
PacketPoolInit();
if (DetectEngineReload(&surifuzz) < 0) {
tmm_modules[TMM_FLOWWORKER].ThreadInit(&tv, NULL, &fwd);
StatsSetupPrivate(&tv);
- extern uint16_t max_pending_packets;
+ extern uint32_t max_pending_packets;
max_pending_packets = 128;
PacketPoolInit();
SC_ATOMIC_SET(engine_stage, SURICATA_RUNTIME);
tmm_modules[TMM_FLOWWORKER].ThreadInit(&tv, NULL, &fwd);
StatsSetupPrivate(&tv);
- extern uint16_t max_pending_packets;
+ extern uint32_t max_pending_packets;
max_pending_packets = 128;
PacketPoolInit();
SC_ATOMIC_SET(engine_stage, SURICATA_RUNTIME);
#include "util-validate.h"
#include "action-globals.h"
-extern uint16_t max_pending_packets;
+extern uint32_t max_pending_packets;
/* Number of freed packet to save for one pool before freeing them. */
#define MAX_PENDING_RETURN_PACKETS 32
/* pre allocate packets */
SCLogDebug("preallocating packets... packet size %" PRIuMAX "",
(uintmax_t)SIZE_OF_PACKET);
- int i = 0;
- for (i = 0; i < max_pending_packets; i++) {
+ for (uint32_t i = 0; i < max_pending_packets; i++) {
Packet *p = PacketGetFromAlloc();
if (unlikely(p == NULL)) {
FatalError("Fatal error encountered while allocating a packet. Exiting...");
*/
void PacketPoolPostRunmodes(void)
{
- extern uint16_t max_pending_packets;
- uint16_t pending_packets = max_pending_packets;
+ extern uint32_t max_pending_packets;
+ uint32_t pending_packets = max_pending_packets;
if (pending_packets < RESERVED_PACKETS) {
FatalError("'max-pending-packets' setting "
"must be at least %d",