]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
pfring: fix StringParse* warnings
authorShivani Bhardwaj <shivanib134@gmail.com>
Wed, 1 Jul 2020 18:14:50 +0000 (23:44 +0530)
committerShivani Bhardwaj <shivanib134@gmail.com>
Wed, 8 Jul 2020 18:30:58 +0000 (00:00 +0530)
Closes redmine ticket 3808.

src/runmode-pfring.c

index 03c0fea7e6b36ec3c315432a8495767fb298f35c..7359ba1df60baee1d0edcb020f6629f146f0de77 100644 (file)
@@ -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;