From 7807b47ca0c5230a0ad911589f00bf7484a13e24 Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Thu, 25 Sep 2025 06:18:40 +0200 Subject: [PATCH] pfring: update thread count callback to match API change Use uint16_t internally and in parsing as well. --- plugins/pfring/runmode-pfring.c | 4 ++-- plugins/pfring/source-pfring.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/pfring/runmode-pfring.c b/plugins/pfring/runmode-pfring.c index 6a37ca2ea2..ef2732aaf0 100644 --- a/plugins/pfring/runmode-pfring.c +++ b/plugins/pfring/runmode-pfring.c @@ -115,7 +115,7 @@ static void *OldParsePfringConfig(const char *iface) pfconf->threads = 1; } else { if (threadsstr != NULL) { - if (StringParseInt32(&pfconf->threads, 10, 0, threadsstr) < 0) { + if (StringParseUnt16(&pfconf->threads, 10, 0, threadsstr) < 0) { SCLogWarning("Invalid value for " "pfring.threads: '%s'. Resetting to 1.", threadsstr); @@ -396,7 +396,7 @@ static void *ParsePfringConfig(const char *iface) return pfconf; } -static int PfringConfigGetThreadsCount(void *conf) +static uint16_t PfringConfigGetThreadsCount(void *conf) { PfringIfaceConfig *pfp = (PfringIfaceConfig *)conf; return pfp->threads; diff --git a/plugins/pfring/source-pfring.h b/plugins/pfring/source-pfring.h index 6ec96113c6..2f5de25e7f 100644 --- a/plugins/pfring/source-pfring.h +++ b/plugins/pfring/source-pfring.h @@ -41,7 +41,7 @@ typedef struct PfringIfaceConfig_ { char iface[PFRING_IFACE_NAME_LENGTH]; /* number of threads */ - int threads; + uint16_t threads; const char *bpf_filter;