From 6224303b287dff9af046900841e43517479c37d0 Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Fri, 14 Jun 2013 17:02:44 +0200 Subject: netsniff-ng: Report if HW timestamping is enabled Until now we didn't check the return value of set_sockopt_hwtimestamp() and the Coverity scanner complained about it, so use it's return value to report if timstamping is actually enabled in verbose mode. Signed-off-by: Tobias Klauser --- netsniff-ng.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'netsniff-ng.c') diff --git a/netsniff-ng.c b/netsniff-ng.c index 2738b9a..c5570fc 100644 --- a/netsniff-ng.c +++ b/netsniff-ng.c @@ -915,7 +915,9 @@ static void recv_only_or_dump(struct ctx *ctx) bpf_dump_all(&bpf_ops); bpf_attach_to_sock(sock, &bpf_ops); - set_sockopt_hwtimestamp(sock, ctx->device_in); + ret = set_sockopt_hwtimestamp(sock, ctx->device_in); + if (ret == 0 && ctx->verbose) + printf("HW timestamping enabled\n"); setup_rx_ring_layout(sock, &rx_ring, size, true, true); create_rx_ring(sock, &rx_ring, ctx->verbose); -- cgit v1.2.3-54-g00ecf