ping6 doesn't handle IPv6 addresses well
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
iputils (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
ping6 utility, iputils-s20121221, Ubuntu 16.04.4 amd64
IPv6 address can have extension with local interface. It is required to ping link-level IPv6 addresses (fe80::/10).
Example,
ping6 fails, OS doesn't know where to route packets
user@test$ ping6 -c1 fe80::87f4:
connect: Invalid argument
network interface is specified, ping6 works:
user@test$ ping6 -c1 fe80::87f4:
PING fe80::87f4:
64 bytes from fe80::87f4:
--- fe80::87f4:
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.461/0.
Ping loopback, it works
user@test$ ping6 -c1 ::1
PING ::1(::1) 56 data bytes
64 bytes from ::1: icmp_seq=1 ttl=64 time=0.039 ms
--- ::1 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.039/0.
But when I add %lo, ping6 cannot handle it.... This is the issue I want to report.
user@test$ ping6 -c1 ::1%lo
unknown host
Other example with real IPv6 address
user@test$ ping6 -c1 2001:470:6e:66::2
PING 2001:470:
64 bytes from 2001:470:6e:66::2: icmp_seq=1 ttl=64 time=0.054 ms
--- 2001:470:6e:66::2 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.054/0.
user@test$ ping6 -c1 2001:470:
unknown host
BTW, CURL can do it...
user@test$ curl http://[::1%lo]/test.htm
<html><
user@test$ curl http://[2001:470:
curl: (7) Failed to connect to 2001:470:6e:66::2 port 80: Connection refused
Yes, curl fails in this case but there is no http server configured at that IPv6 address... Important point is it tries to connect. Here is a proof:
user@test$ curl http://[2001:470:
SSH-2.0-
Protocol mismatch.
curl: (56) Recv failure: Connection reset by peer
Here is a reference to RFC
https:/