summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--built_in.h7
-rw-r--r--netsniff-ng.c2
2 files changed, 8 insertions, 1 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
diff --git a/netsniff-ng.c b/netsniff-ng.c
index 78b5666..47edbcd 100644
--- a/netsniff-ng.c
+++ b/netsniff-ng.c
@@ -906,7 +906,7 @@ static void recv_only_or_dump(struct ctx *ctx)
printf("HW timestamping enabled\n");
}
- ring_rx_setup(&rx_ring, sock, size, ifindex, &rx_poll, true, true, ctx->verbose);
+ ring_rx_setup(&rx_ring, sock, size, ifindex, &rx_poll, is_defined(HAVE_TPACKET3), true, ctx->verbose);
dissector_init_all(ctx->print_mode);