From: Victor Julien Date: Mon, 8 May 2017 12:47:58 +0000 (+0200) Subject: pfring: compiler warning fixes X-Git-Tag: suricata-4.0.0-beta1~89 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F2697%2Fhead;p=thirdparty%2Fsuricata.git pfring: compiler warning fixes --- diff --git a/src/runmode-pfring.c b/src/runmode-pfring.c index dcfe322a6c..f5ac475d12 100644 --- a/src/runmode-pfring.c +++ b/src/runmode-pfring.c @@ -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(); diff --git a/src/source-pfring.c b/src/source-pfring.c index b721dd6caf..ed387583c2 100644 --- a/src/source-pfring.c +++ b/src/source-pfring.c @@ -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 */