]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
af-packet: improve xdp error handling
authorEric Leblond <eric@regit.org>
Sat, 30 Dec 2017 21:04:04 +0000 (22:04 +0100)
committerEric Leblond <eric@regit.org>
Tue, 6 Feb 2018 15:58:19 +0000 (16:58 +0100)
Don't try to bypass the flow if the flow table is unknown.

Also continue after error message if ever XDP was not correctly
setup.

src/runmode-af-packet.c
src/source-af-packet.c

index 1b15a28d000b8d66be3ef5400e965632f6e20609..71337df9c6aee2069004352bc688ead84b8f3785 100644 (file)
@@ -479,7 +479,6 @@ static void *ParseAFPConfig(const char *iface)
             if (ret != 0) {
                 SCLogWarning(SC_ERR_INVALID_VALUE,
                              "Error when setting up XDP");
-                /* FIXME error handling */
             }
         }
 #else
index fa4bacd5ca9d2d39c8ff2ce3b2a4c9c0840db874..a7710b46ff0f72d2de99bb993fdb3b9547f5bdd5 100644 (file)
@@ -2262,10 +2262,14 @@ TmEcode AFPSetBPFFilter(AFPThreadVars *ptv)
  */
 static int AFPInsertHalfFlow(int mapd, void *key, uint64_t inittime)
 {
-    /* FIXME error handling */
     unsigned int nr_cpus = UtilCpuGetNumProcessorsConfigured();
     struct pair value[nr_cpus];
     unsigned int i;
+
+    if (mapd == -1) {
+        return 0;
+    }
+
     for (i = 0; i < nr_cpus; i++) {
         value[i].time = inittime;
         value[i].packets = 0;