pfring: fix StringParse* warnings

Closes redmine ticket 3808.
pull/5148/head
Shivani Bhardwaj 6 years ago
parent 7cbb8c44c5
commit d27b407bc3

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

Loading…
Cancel
Save