Skip to content

Commit 05b8f45

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 6a67865 commit 05b8f45

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

CHANGELOG.md

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ Next
77
@JoshIPT, @sebast-gsnw and @auerswal)
88
- The -g, --generate option now also supports IPv6 addresses (#376,
99
thanks @auerswal)
10-
1110
- New option --seqmap-timeout to control the time after which sequence numbers
1211
can be used again (#388, thanks @auerswal)
1312

@@ -16,17 +15,15 @@ Next
1615
- Fix OpenBSD warning sprintf() is often misused, please use snprintf() (#394, thanks @gsnw-sebast)
1716
- Fix fallback to SO\_TIMESTAMP if SO\_TIMESTAMPNS is not available (#375,
1817
thanks @auerswal)
19-
2018
- When reading target names from file or standard input, lines longer
2119
than the static buffer are no longer interpreted as more than one line
2220
(#378, thanks @auerswal)
23-
2421
- Typo fix in error message when SO\_BINDTODEVICE fails
25-
2622
- Options --print-tos and --print-ttl now also work for IPv6, and no
2723
longer require privileges (#384, thanks @auerswal)
28-
2924
- Report received ICMPv6 error messages (#391, thanks @auerswal)
25+
- Suppress duplicate reports in count mode with -q, --quiet or -Q, --squiet
26+
(#392, thanks @gsnw-sebast and @auerswal)
3027

3128
fping 5.3 (2025-01-02)
3229
======================

src/fping.c

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

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

0 commit comments

Comments
 (0)