summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobias Klauser <tklauser@distanz.ch>2014-09-29 15:43:17 +0200
committerTobias Klauser <tklauser@distanz.ch>2014-09-29 15:43:17 +0200
commitae5ba8e4d67094e9c61c54669221be69bd232fa8 (patch)
treec993d790b88decc0ecbf65929353cdb8580b9fd5
parent3bde6d40a3352f89b411a6c47a676ca7e201aef3 (diff)
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 <tklauser@distanz.ch>
-rw-r--r--netsniff-ng.c5
1 files 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);