From e22b345bb651d1a578823270e6ca4d92bef4ad85 Mon Sep 17 00:00:00 2001 From: Shivani Bhardwaj Date: Sat, 21 Dec 2019 13:10:25 +0530 Subject: [PATCH] af-packet: change type of cluster_id to uint16_t --- src/runmode-af-packet.c | 4 ++-- src/source-af-packet.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) 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; -- 2.47.2