]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
Improve check of min requirement for AF_PACKET.
authorEric Leblond <eric@regit.org>
Mon, 26 Mar 2012 16:57:42 +0000 (18:57 +0200)
committerVictor Julien <victor@inliniac.net>
Tue, 27 Mar 2012 09:46:58 +0000 (11:46 +0200)
As pointed out by #416, AF_PACKET detection support was not accurate
enough. This patch improves the check by doing a verification of
the availability of the feature level needed to build AF_PACKET.
We need TPACKET_V2 which is available after 2.6.27.

configure.in

index fdf670e7edf4aa18b766c73746d52aabfefb2916..e0528a5b41b527453e242123b0e1a347087cbb9d 100644 (file)
@@ -822,10 +822,11 @@ AC_INIT(configure.in)
            AS_HELP_STRING([--enable-af-packet], [Enable AF_PACKET support [default=yes]]),
                         ,[enable_af_packet=yes])
     AS_IF([test "x$enable_af_packet" = "xyes"], [
-        AC_CHECK_DECL([AF_PACKET],
+        AC_CHECK_DECL([TPACKET_V2],
             AC_DEFINE([HAVE_AF_PACKET],[1],[AF_PACKET support is available]),
-            [enable_af_packet=no],
-            [[#include <sys/socket.h>]])
+            [enable_af_packet="no"],
+            [[#include <sys/socket.h>
+              #include <linux/if_packet.h>]])
         AC_CHECK_DECL([PACKET_FANOUT],
             AC_DEFINE([HAVE_PACKET_FANOUT],[1],[Packet fanout support is available]),
             [],