[Bug 254860] ping flood output incorrectly shows dot for dropped packet

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Wed Apr 7 18:43:04 UTC 2021


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=254860

            Bug ID: 254860
           Summary: ping flood output incorrectly shows dot for dropped
                    packet
           Product: Base System
           Version: CURRENT
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: bin
          Assignee: bugs at FreeBSD.org
          Reporter: jcaplan at blackberry.com

Created attachment 223903
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=223903&action=edit
proposed patch

Overview
--------

The output of the ping with '-f' option always contains one dot symbol
indicating that one packet has been dropped even all ECHO_REPLY have been
received successfully and there is 0.0% packet loss actually.

This is because the final '\b' written in pr_pack() is ignored when
putchar('\n') gets called in finish().

Attached solution diff makes sure in pr_pack() that the DOT is overwritten with
a space.

Steps to Reproduce
------------------
$ sudo ping -f -c1 localhost
PING6(56=40+8+8 bytes) ::1 --> ::1
.
--- localhost ping6 statistics ---
1 packets transmitted, 1 packets received, 0.0% packet loss
round-trip min/avg/max/std-dev = 0.460/0.460/0.460/0.000 ms


Actual Results
--------------
There is a dot in the middle line:
PING6(56=40+8+8 bytes) ::1 --> ::1
.
--- localhost ping6 statistics ---


Expected Results
----------------
No dot.

Build Date & Hardware
---------------------
FreeBSD bsd-vbox 13.0-CURRENT FreeBSD 13.0-CURRENT #0 r368820: Tue Jan  5
17:30:19 EST 2021    
jcaplan at bsd-vbox:/usr/obj/usr/src-head/amd64.amd64/sys/GENERIC  amd64

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-bugs mailing list