]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
pfring: minor cleanups
authorVictor Julien <victor@inliniac.net>
Fri, 19 Oct 2018 13:41:35 +0000 (15:41 +0200)
committerVictor Julien <victor@inliniac.net>
Fri, 19 Oct 2018 14:55:37 +0000 (16:55 +0200)
src/runmode-pfring.c

index ef0b490abaec5432862e3a543037b079519e36b3..9c107b74ee7bd9ac8568a6bc10d16416c7dbb8e9 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2007-2010 Open Information Security Foundation
+/* Copyright (C) 2007-2018 Open Information Security Foundation
  *
  * You can copy, redistribute or modify this Program under the terms of
  * the GNU General Public License version 2 as published by the Free
@@ -375,7 +375,7 @@ static void *ParsePfringConfig(const char *iface)
     return pfconf;
 }
 
-static int PfringConfigGeThreadsCount(void *conf)
+static int PfringConfigGetThreadsCount(void *conf)
 {
     PfringIfaceConfig *pfp = (PfringIfaceConfig *)conf;
     return pfp->threads;
@@ -383,14 +383,13 @@ static int PfringConfigGeThreadsCount(void *conf)
 
 static int PfringConfLevel(void)
 {
-    const char *def_dev;
+    const char *def_dev = NULL;
     /* 1.0 config should return a string */
     if (ConfGet("pfring.interface", &def_dev) != 1) {
         return PFRING_CONF_V2;
     } else {
         return PFRING_CONF_V1;
     }
-    return PFRING_CONF_V2;
 }
 
 static int GetDevAndParser(const char **live_dev, ConfigIfaceParserFunc *parser)
@@ -441,7 +440,7 @@ int RunModeIdsPfringAutoFp(void)
     }
 
     ret = RunModeSetLiveCaptureAutoFp(tparser,
-                              PfringConfigGeThreadsCount,
+                              PfringConfigGetThreadsCount,
                               "ReceivePfring",
                               "DecodePfring", thread_name_autofp,
                               live_dev);
@@ -478,7 +477,7 @@ int RunModeIdsPfringSingle(void)
     }
 
     ret = RunModeSetLiveCaptureSingle(tparser,
-                              PfringConfigGeThreadsCount,
+                              PfringConfigGetThreadsCount,
                               "ReceivePfring",
                               "DecodePfring", thread_name_single,
                               live_dev);
@@ -515,7 +514,7 @@ int RunModeIdsPfringWorkers(void)
     }
 
     ret = RunModeSetLiveCaptureWorkers(tparser,
-                              PfringConfigGeThreadsCount,
+                              PfringConfigGetThreadsCount,
                               "ReceivePfring",
                               "DecodePfring", thread_name_workers,
                               live_dev);