]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
af-packet: declare TP_STATUS_VLAN_VALID if needed
authorEric Leblond <eric@regit.org>
Sat, 8 Feb 2014 21:01:13 +0000 (22:01 +0100)
committerVictor Julien <victor@inliniac.net>
Sun, 9 Feb 2014 10:04:36 +0000 (11:04 +0100)
Some old distribution don't ship recent enough linux header. This
result in TP_STATUS_VLAN_VALID being undefined. This patch defines
the constant and use it as it is used in backward compatible method
in the code: the flag is not set by kernel and a test on vci value
will be made.

This should fix https://redmine.openinfosecfoundation.org/issues/1106

src/source-af-packet.c

index 02a67a7aebeb5647a1087862638f8416e8ee188d..63d7051646dceda4f5c4a43f7354656b4373ea04 100644 (file)
@@ -157,6 +157,10 @@ TmEcode NoAFPSupportExit(ThreadVars *tv, void *initdata, void **data)
 #define TP_STATUS_USER_BUSY (1 << 31)
 #endif
 
+#ifndef TP_STATUS_VLAN_VALID
+#define TP_STATUS_VLAN_VALID (1 << 4)
+#endif
+
 /** protect pfring_set_bpf_filter, as it is not thread safe */
 static SCMutex afpacket_bpf_set_filter_lock = SCMUTEX_INITIALIZER;