Opened 3 months ago

Closed 3 months ago

#18807 closed bug (fixed)

ping handles float intervals incorrectly

Reported by: dovsienko Owned by: nobody
Priority: low Milestone: R1/beta5
Component: Applications/Command Line Tools Version: R1/Development
Keywords: Cc:
Blocked By: Blocking:
Platform: All

Description

This uses an interval of one second (correct):

~> ping -n -i 1 127.0.0.1
~> ping -n 127.0.0.1

This uses an interval of two seconds (correct):

~> ping -n -i 2 127.0.0.1

This rejects an invalid interval value (correct):

~> ping -n -i 0 127.0.0.1
error: bad timing interval: 0
~> ping -n -i -1 127.0.0.1
error: bad timing interval: -1

This uses an interval of one second (incorrect):

~> ping -n -i 1.99999999 127.0.0.1

This receives the first reply and then waits indefinitely until Ctrl-C:

~> ping -n -i 0.99999999 127.0.0.1

If this implementation of ping does not support float intervals, it should reject such values with an error message, as it does above.

Change History (3)

comment:1 by waddlesplash, 3 months ago

Component: Network & InternetApplications/Command Line Tools

comment:2 by dovsienko, 3 months ago

The practical meaning of this is, I often run ping with "-i 0.2" to have a faster feedback loop when troubleshooting network issues. When the output stops after the first reply, on the surface it looks the same as a network problem.

comment:3 by waddlesplash, 3 months ago

Milestone: UnscheduledR1/beta5
Resolution: fixed
Status: newclosed

Fixed by merging a newer FreeBSD ping in hrev57594.

Note: See TracTickets for help on using tickets.