From: Shivani Bhardwaj Date: Wed, 1 Jul 2020 18:14:50 +0000 (+0530) Subject: pfring: fix StringParse* warnings X-Git-Tag: suricata-6.0.0-beta1~229 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d27b407bc3805776c285308cb305233e092fb741;p=thirdparty%2Fsuricata.git pfring: fix StringParse* warnings Closes redmine ticket 3808. --- diff --git a/src/runmode-pfring.c b/src/runmode-pfring.c index 03c0fea7e6..7359ba1df6 100644 --- a/src/runmode-pfring.c +++ b/src/runmode-pfring.c @@ -124,7 +124,7 @@ static void *OldParsePfringConfig(const char *iface) pfconf->threads = 1; } else { if (threadsstr != NULL) { - if (StringParseUint16(&pfconf->threads, 10, 0, threadsstr) < 0) { + if (StringParseInt32(&pfconf->threads, 10, 0, threadsstr) < 0) { SCLogWarning(SC_ERR_INVALID_VALUE, "Invalid value for " "pfring.threads: '%s'. Resetting to 1.", threadsstr); pfconf->threads = 1; @@ -146,7 +146,7 @@ static void *OldParsePfringConfig(const char *iface) } else if (ConfGet("pfring.cluster-id", &tmpclusterid) != 1) { SCLogError(SC_ERR_INVALID_ARGUMENT,"Could not get cluster-id from config"); } else { - if (StringParseUint16(&pfconf->cluster_id, 10, 0, (const char *)tmpclusterid) < 0) { + if (StringParseInt32(&pfconf->cluster_id, 10, 0, (const char *)tmpclusterid) < 0) { SCLogWarning(SC_ERR_INVALID_VALUE, "Invalid value for " "pfring.cluster_id: '%s'. Resetting to 1.", tmpclusterid); pfconf->cluster_id = 1; @@ -280,7 +280,7 @@ static void *ParsePfringConfig(const char *iface) /* command line value has precedence */ if (ConfGet("pfring.cluster-id", &tmpclusterid) == 1) { - if (StringParseUint16(&pfconf->cluster_id, 10, 0, (const char *)tmpclusterid) < 0) { + if (StringParseInt32(&pfconf->cluster_id, 10, 0, (const char *)tmpclusterid) < 0) { SCLogWarning(SC_ERR_INVALID_VALUE, "Invalid value for " "pfring.cluster-id: '%s'. Resetting to 1.", tmpclusterid); pfconf->cluster_id = 1; @@ -300,7 +300,7 @@ static void *ParsePfringConfig(const char *iface) SCLogError(SC_ERR_INVALID_ARGUMENT, "Could not get cluster-id from config"); } else { - if (StringParseUint16(&pfconf->cluster_id, 10, 0, (const char *)tmpclusterid) < 0) { + if (StringParseInt32(&pfconf->cluster_id, 10, 0, (const char *)tmpclusterid) < 0) { SCLogWarning(SC_ERR_INVALID_VALUE, "Invalid value for " "pfring.cluster-id: '%s'. Resetting to 1.", tmpclusterid); pfconf->cluster_id = 1;