Skip to content

Commit

Permalink
netsniff-ng: remove unnecessary zeroing of packet counters in init_ctx()
Browse files Browse the repository at this point in the history
The struct ctx in initialized using memset(ctx, 0, sizeof(*ctx) in
init_ctx(), so there is no need to zero these members again.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
  • Loading branch information
tklauser committed Apr 12, 2017
1 parent eedf26d commit 4a4b85a
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions netsniff-ng.c
Expand Up @@ -1196,12 +1196,6 @@ static void init_ctx(struct ctx *ctx)
ctx->promiscuous = true;
ctx->randomize = false;
ctx->hwtimestamp = true;

ctx->pkts_recvd = 0;
ctx->pkts_seen = 0;
ctx->pkts_drops = 0;
ctx->pkts_recvd_last = 0;
ctx->pkts_drops_last = 0;
}

static void destroy_ctx(struct ctx *ctx)
Expand Down

0 comments on commit 4a4b85a

Please sign in to comment.