From 9556751e3272308b048667e739b1baeeb5a2cbd5 Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Mon, 29 Sep 2014 16:54:12 +0200 Subject: 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 Signed-off-by: Tobias Klauser --- netsniff-ng.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'netsniff-ng.c') 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); -- cgit v1.2.3-54-g00ecf