From ae5ba8e4d67094e9c61c54669221be69bd232fa8 Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Mon, 29 Sep 2014 15:43:17 +0200 Subject: netsniff-ng: Move variable definition Save one #ifdef block by moving the tpacket v3 only variable definition to the block where it is actually used. Signed-off-by: Tobias Klauser --- netsniff-ng.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/netsniff-ng.c b/netsniff-ng.c index 88c48fb..78b5666 100644 --- a/netsniff-ng.c +++ b/netsniff-ng.c @@ -878,9 +878,6 @@ static void recv_only_or_dump(struct ctx *ctx) struct sock_fprog bpf_ops; struct timeval start, end, diff; unsigned long frame_count = 0; -#ifdef HAVE_TPACKET3 - struct block_desc *pbd; -#endif sock = pf_socket(); @@ -952,6 +949,8 @@ static void recv_only_or_dump(struct ctx *ctx) while (likely(sigint == 0)) { #ifdef HAVE_TPACKET3 + struct block_desc *pbd; + while (user_may_pull_from_rx_block((pbd = rx_ring.frames[it].iov_base))) { walk_t3_block(pbd, ctx, sock, &fd, &frame_count); -- cgit v1.2.3-54-g00ecf