]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
pfring: compiler warning fixes 2697/head
authorVictor Julien <victor@inliniac.net>
Mon, 8 May 2017 12:47:58 +0000 (14:47 +0200)
committerVictor Julien <victor@inliniac.net>
Mon, 8 May 2017 12:47:58 +0000 (14:47 +0200)
src/runmode-pfring.c
src/source-pfring.c

index dcfe322a6c53f3b5336ad05d8788441ff53eb21c..f5ac475d123e44600b021f409a908ce3885ba5f5 100644 (file)
@@ -92,10 +92,10 @@ static void PfringDerefConfig(void *conf)
  */
 static void *OldParsePfringConfig(const char *iface)
 {
-    char *threadsstr = NULL;
+    const char *threadsstr = NULL;
     PfringIfaceConfig *pfconf = SCMalloc(sizeof(*pfconf));
-    char *tmpclusterid;
-    char *tmpctype = NULL;
+    const char *tmpclusterid;
+    const char *tmpctype = NULL;
     cluster_type default_ctype = CLUSTER_ROUND_ROBIN;
 
     if (unlikely(pfconf == NULL)) {
@@ -185,16 +185,16 @@ static void *OldParsePfringConfig(const char *iface)
  */
 static void *ParsePfringConfig(const char *iface)
 {
-    char *threadsstr = NULL;
+    const char *threadsstr = NULL;
     ConfNode *if_root;
     ConfNode *if_default = NULL;
     ConfNode *pf_ring_node;
     PfringIfaceConfig *pfconf = SCMalloc(sizeof(*pfconf));
-    char *tmpclusterid;
-    char *tmpctype = NULL;
+    const char *tmpclusterid;
+    const char *tmpctype = NULL;
     cluster_type default_ctype = CLUSTER_ROUND_ROBIN;
     int getctype = 0;
-    char *bpf_filter = NULL;
+    const char *bpf_filter = NULL;
 
     if (unlikely(pfconf == NULL)) {
         return NULL;
@@ -363,9 +363,9 @@ static int PfringConfigGeThreadsCount(void *conf)
     return pfp->threads;
 }
 
-static int PfringConfLevel()
+static int PfringConfLevel(void)
 {
-    char *def_dev;
+    const char *def_dev;
     /* 1.0 config should return a string */
     if (ConfGet("pfring.interface", &def_dev) != 1) {
         return PFRING_CONF_V2;
@@ -375,7 +375,7 @@ static int PfringConfLevel()
     return PFRING_CONF_V2;
 }
 
-static int GetDevAndParser(char **live_dev, ConfigIfaceParserFunc *parser)
+static int GetDevAndParser(const char **live_dev, ConfigIfaceParserFunc *parser)
 {
      ConfGet("pfring.live-interface", live_dev);
 
@@ -408,7 +408,7 @@ int RunModeIdsPfringAutoFp(void)
 /* We include only if pfring is enabled */
 #ifdef HAVE_PFRING
     int ret;
-    char *live_dev = NULL;
+    const char *live_dev = NULL;
     ConfigIfaceParserFunc tparser;
 
     RunModeInitialize();
@@ -445,7 +445,7 @@ int RunModeIdsPfringSingle(void)
 /* We include only if pfring is enabled */
 #ifdef HAVE_PFRING
     int ret;
-    char *live_dev = NULL;
+    const char *live_dev = NULL;
     ConfigIfaceParserFunc tparser;
 
     RunModeInitialize();
@@ -482,7 +482,7 @@ int RunModeIdsPfringWorkers(void)
 /* We include only if pfring is enabled */
 #ifdef HAVE_PFRING
     int ret;
-    char *live_dev = NULL;
+    const char *live_dev = NULL;
     ConfigIfaceParserFunc tparser;
 
     RunModeInitialize();
index b721dd6caf9cdeac55c96893dd93a97d4adf6218..ed387583c297780646409d18d18f426844404d71 100644 (file)
@@ -504,7 +504,7 @@ TmEcode ReceivePfringThreadInit(ThreadVars *tv, const void *initdata, void **dat
         return TM_ECODE_FAILED;
     }
 
-    pfring_set_application_name(ptv->pd, PROG_NAME);
+    pfring_set_application_name(ptv->pd, (char *)PROG_NAME);
     pfring_version(ptv->pd, &version);
 
     /* We only set cluster info if the number of pfring threads is greater than 1 */