summaryrefslogtreecommitdiff
path: root/netsniff-ng.c
diff options
context:
space:
mode:
authorTobias Klauser <tklauser@distanz.ch>2013-06-14 17:02:44 +0200
committerTobias Klauser <tklauser@distanz.ch>2013-06-14 17:04:15 +0200
commit6224303b287dff9af046900841e43517479c37d0 (patch)
treeb433f489101f16d6fc66434635823dde66b061e3 /netsniff-ng.c
parent9d1ee4f333586967b75760226e781b1ebd181786 (diff)
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 <tklauser@distanz.ch>
Diffstat (limited to 'netsniff-ng.c')
-rw-r--r--netsniff-ng.c4
1 files changed, 3 insertions, 1 deletions
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);