Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ping: support IPv4-Mapped-in-IPv6 target addresses
Addresses of the form ::ffff:127.0.0.1 would be treated as IPv6. Check the target early and switch to IPv4 path if found. $ ./builddir/ping/ping -c1 -v ::ffff:127.0.0.1 ./builddir/ping/ping: IPv4-Mapped-in-IPv6 address, using IPv4 127.0.0.1 ./builddir/ping/ping: sock4.fd: 3 (socktype: SOCK_DGRAM), sock6.fd: -1 (socktype: 0), hints.ai_family: AF_INET ai->ai_family: AF_INET, ai->ai_canonname: '127.0.0.1' PING 127.0.0.1 (127.0.0.1) 56(84) bytes of data. 64 bytes from localhost (127.0.0.1): icmp_seq=1 ttl=64 time=0.058 ms Closes: iputils#558 Reviewed-by: Petr Vorel <[email protected]> Signed-off-by: Tj <[email protected]> [ pvorel: use _() to translate, error() to redirect to stderr ] Signed-off-by: Petr Vorel <[email protected]>
- Loading branch information