Skip to content

Commit 3e8b905

Browse files
committed
suppress duplicate reports with -c/-C and -q/-Q
If fping receives a duplicate Echo Reply packet, it reports this. This report was suppressed for loop mode, and for other operating modes where each receive event is reported. Now, this duplicate report is also suppressed when in count mode with options -q, --quiet or -Q, --squiet. This addresses GitHub issue #389.
1 parent b00bb5a commit 3e8b905

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ Next
2424
- Options --print-tos and --print-ttl now also work for IPv6, and no
2525
longer require privileges (#384, thanks @auerswal)
2626

27+
- Suppress duplicate reports in count mode with -q, --quiet or -Q, --squiet
28+
(#392, thanks @gsnw-sebast and @auerswal)
29+
2730
fping 5.3 (2025-01-02)
2831
======================
2932

src/fping.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2816,7 +2816,7 @@ int wait_for_reply(int64_t wait_time)
28162816
}
28172817

28182818
/* discard duplicates */
2819-
if (!loop_flag && h->resp_times[this_count] >= 0) {
2819+
if (!loop_flag && !(count_flag && quiet_flag) && h->resp_times[this_count] >= 0) {
28202820
if (!per_recv_flag) {
28212821
fprintf(stderr, "%s : duplicate for [%d], %d bytes, %s ms",
28222822
h->host, this_count, result, sprint_tm(this_reply));

0 commit comments

Comments
 (0)