]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
Give Suricata priority to receive packets over Linux with mPIPE.
authorKen Steele <ken@tilera.com>
Mon, 11 Nov 2013 20:54:47 +0000 (15:54 -0500)
committerVictor Julien <victor@inliniac.net>
Tue, 12 Nov 2013 09:45:50 +0000 (10:45 +0100)
When installing the rules to tell mPIPE to send packet to Suricata,
give it a higher priority than the default used by Linux. This way if
Linux also tells mPIPE to send it packets, Suricata will get them
instead, as long as Suricata is running.

src/source-mpipe.c

index 01547391a7d66f9b6c330a74436981aa6ed15f87..969d0ea945b09ede52b833fe7138ee08becf1ceb 100644 (file)
@@ -694,6 +694,8 @@ static int ReceiveMpipeRegisterRules(int bucket, int num_buckets)
     gxio_mpipe_rules_t rules;
     gxio_mpipe_rules_init(&rules, context);
     gxio_mpipe_rules_begin(&rules, bucket, num_buckets, NULL);
+    /* Give Suricata priority over Linux to receive packets. */
+    gxio_mpipe_rules_set_priority(&rules, -100);
     return gxio_mpipe_rules_commit(&rules);
 }