Bug 260314 - ping6: faulty "-4 and -6 cannot be used simultaneously" error on "ping6 -c4 localhost"
Summary: ping6: faulty "-4 and -6 cannot be used simultaneously" error on "ping6 -c4 l...
Status: Closed DUPLICATE of bug 258048
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 13.0-STABLE
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-12-10 11:41 UTC by Franco Fichtner
Modified: 2021-12-12 07:27 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Franco Fichtner 2021-12-10 11:41:22 UTC
This works fine on 12.1. The "4" is part of the count -c argument. "ping6 -c 4 localhost" still works as expected.


Cheers,
Franco
Comment 1 Franco Fichtner 2021-12-10 12:04:40 UTC
The parsing of trying to validate -4 against -6 is so lax that this triggers on unknown and malformed arguments as well (things that don't actually take arguments). The most worrisome bug happens on

# ping -c6 localhost

Which pings localhost 6 times as expected, but with ping6 utility instead of ping (using ::1) as target.


Cheers,
Franco
Comment 2 Graham Perrin freebsd_committer freebsd_triage 2021-12-12 00:20:33 UTC
(In reply to Franco Fichtner from comment #1)

% ping localhost
PING6(56=40+8+8 bytes) ::1 --> ::1
16 bytes from ::1, icmp_seq=0 hlim=64 time=0.039 ms
16 bytes from ::1, icmp_seq=1 hlim=64 time=0.086 ms
16 bytes from ::1, icmp_seq=2 hlim=64 time=0.048 ms
16 bytes from ::1, icmp_seq=3 hlim=64 time=0.046 ms
16 bytes from ::1, icmp_seq=4 hlim=64 time=0.078 ms
16 bytes from ::1, icmp_seq=5 hlim=64 time=0.076 ms
16 bytes from ::1, icmp_seq=6 hlim=64 time=0.098 ms
^C
--- localhost ping6 statistics ---
7 packets transmitted, 7 packets received, 0.0% packet loss
round-trip min/avg/max/std-dev = 0.039/0.067/0.098/0.021 ms
%
Comment 3 Graham Perrin freebsd_committer freebsd_triage 2021-12-12 00:25:34 UTC
% uname -KU
1400043 1400043
% ping -4 -c6 localhost
PING localhost (127.0.0.1): 56 data bytes
64 bytes from 127.0.0.1: icmp_seq=0 ttl=64 time=0.030 ms
64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0.030 ms
64 bytes from 127.0.0.1: icmp_seq=2 ttl=64 time=0.053 ms
64 bytes from 127.0.0.1: icmp_seq=3 ttl=64 time=0.075 ms
64 bytes from 127.0.0.1: icmp_seq=4 ttl=64 time=0.066 ms
64 bytes from 127.0.0.1: icmp_seq=5 ttl=64 time=0.073 ms

--- localhost ping statistics ---
6 packets transmitted, 6 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 0.030/0.055/0.075/0.019 ms
% 

<https://www.freebsd.org/cgi/man.cgi?query=ping&sektion=8&manpath=FreeBSD>
Comment 4 Graham Perrin freebsd_committer freebsd_triage 2021-12-12 00:30:40 UTC
(In reply to Franco Fichtner from comment #1)

> … ping6 utility instead of ping …

What are their inodes on 13.0-STABLE?

Here, the inode is identical: 

% freebsd-version -k
14.0-CURRENT
% ls -i /sbin/ping
5290690 /sbin/ping
% ls -i /sbin/ping6
5290690 /sbin/ping6
%
Comment 5 Franco Fichtner 2021-12-12 07:27:55 UTC
Thanks for the hint.  Looks like this is missing an MFC to stable/13.   Moving to other ticket.


Cheers,
Franco

*** This bug has been marked as a duplicate of bug 258048 ***