diff options
author | Tobias Klauser <tklauser@distanz.ch> | 2014-09-29 15:43:17 +0200 |
---|---|---|
committer | Tobias Klauser <tklauser@distanz.ch> | 2014-09-29 15:43:17 +0200 |
commit | ae5ba8e4d67094e9c61c54669221be69bd232fa8 (patch) | |
tree | c993d790b88decc0ecbf65929353cdb8580b9fd5 | |
parent | 3bde6d40a3352f89b411a6c47a676ca7e201aef3 (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.c | 5 |
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); |