]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
af-packet: change type of cluster_id to uint16_t
authorShivani Bhardwaj <shivanib134@gmail.com>
Sat, 21 Dec 2019 07:40:25 +0000 (13:10 +0530)
committerVictor Julien <victor@inliniac.net>
Sat, 25 Apr 2020 06:01:46 +0000 (08:01 +0200)
src/runmode-af-packet.c
src/source-af-packet.h

index 0f56b11eaf65b6878dbf116ce512e6c619837a85..f7b2647b804233a6817c6d1149d723d94ea7e3db 100644 (file)
@@ -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) {
index 0468e4b2ffff576b259b4f4d6877aa879102676d..69706bf48ee57da21bc3f861ba9881038b2fef0a 100644 (file)
@@ -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;