From: Shivani Bhardwaj Date: Sat, 21 Dec 2019 07:40:25 +0000 (+0530) Subject: af-packet: change type of cluster_id to uint16_t X-Git-Tag: suricata-6.0.0-beta1~468 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e22b345bb651d1a578823270e6ca4d92bef4ad85;p=thirdparty%2Fsuricata.git af-packet: change type of cluster_id to uint16_t --- diff --git a/src/runmode-af-packet.c b/src/runmode-af-packet.c index 0f56b11eaf..f7b2647b80 100644 --- a/src/runmode-af-packet.c +++ b/src/runmode-af-packet.c @@ -294,11 +294,11 @@ static void *ParseAFPConfig(const char *iface) if (ConfGetChildValueWithDefault(if_root, if_default, "cluster-id", &tmpclusterid) != 1) { aconf->cluster_id = (uint16_t)(cluster_id_auto++); } else { - if (StringParseInt32(&aconf->cluster_id, 10, 0, (const char *)tmpclusterid) < 0) { + if (StringParseUint16(&aconf->cluster_id, 10, 0, (const char *)tmpclusterid) < 0) { SCLogWarning(SC_ERR_INVALID_VALUE, "Invalid cluster_id, resetting to 0"); aconf->cluster_id = 0; } - SCLogDebug("Going to use cluster-id %" PRId32, aconf->cluster_id); + SCLogDebug("Going to use cluster-id %" PRIu16, aconf->cluster_id); } if (ConfGetChildValueWithDefault(if_root, if_default, "cluster-type", &tmpctype) != 1) { diff --git a/src/source-af-packet.h b/src/source-af-packet.h index 0468e4b2ff..69706bf48e 100644 --- a/src/source-af-packet.h +++ b/src/source-af-packet.h @@ -92,7 +92,7 @@ typedef struct AFPIfaceConfig_ /* block timeout for tpacket_v3 in milliseconds */ int block_timeout; /* cluster param */ - int cluster_id; + uint16_t cluster_id; int cluster_type; /* promisc mode */ int promisc;