summaryrefslogtreecommitdiff
path: root/built_in.h
diff options
context:
space:
mode:
authorTobias Klauser <tklauser@distanz.ch>2014-09-29 16:54:12 +0200
committerTobias Klauser <tklauser@distanz.ch>2014-09-29 16:54:12 +0200
commit9556751e3272308b048667e739b1baeeb5a2cbd5 (patch)
treeaca47a76422d95c86536e995644b6226c91fe659 /built_in.h
parent4f2c32268c348c086063d429d705022d8fdb2747 (diff)
netsniff-ng: Fix tpacketv2-only capturing
We need to set up the RX ring depending on whether tpacket v3 is available or not. Otherwise end up setting its structure up for tpacket v3, even though only tpacket v2 is available. This should fix packet capturing for tpacket v2 (i.e. corrupted frames in pcap). Reported-by: Mike Reeves <luke@geekempire.com> Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Diffstat (limited to 'built_in.h')
-rw-r--r--built_in.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/built_in.h b/built_in.h
index aab4ef6..92996ce 100644
--- a/built_in.h
+++ b/built_in.h
@@ -96,6 +96,13 @@ typedef uint8_t u8;
# define __force /* unimplemented */
#endif
+/* see config_enabled et al. in linux/kconfig.h for details. */
+#define __ARG_PLACEHOLDER_1 0,
+#define is_defined(cfg) _is_defined(cfg)
+#define _is_defined(value) __is_defined(__ARG_PLACEHOLDER_##value)
+#define __is_defined(arg1_or_junk) ___is_defined(arg1_or_junk 1, 0)
+#define ___is_defined(__ignored, val, ...) val
+
#ifndef force_cast
# define force_cast(type, arg) ((type) (arg))
#endif