Skip to content

Commit

Permalink
Revert "ping: support IPv4-Mapped-in-IPv6 target addresses"
Browse files Browse the repository at this point in the history
This reverts commit 8ed7ffc.

This is an incomplete implementation. While there are two attempts
(PR#562 [1] PR#562 [2] and PR#563 [3]) to fix it, it's probably not a
good idea to support IPv4-Mapped-in-IPv6 target addresses.

There were concerns [4] about supporting this when discussion on BusyBox
mailing list about patch bringing this functionality to BusyBox ping
implementation:

* ping is a low-level diagnostic tool, maybe it's not good to assume
  things like this, because IPv4-mapped IPv6 address format is not
  supported by raw sockets
* it's not clear how -4 -6 switches should behave

NOTE: next commit fixes IPv4-Mapped-in-IPv6 target addresses via -4
flag.

Because also fping did not want to support it [6], let's revert the
feature.

[1] iputils#561
[2] iputils#563
[3] iputils#562
[4] https://lists.busybox.net/pipermail/busybox/2024-October/090975.html
[5] https://lists.busybox.net/pipermail/busybox/2024-October/090985.html
[6] schweikert/fping#356

Closes: iputils#567
Reviewed-by: Ronan Pigott <[email protected]>
Signed-off-by: Petr Vorel <[email protected]>
  • Loading branch information
pevik committed Nov 27, 2024
1 parent e8c9d6d commit 777868c
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions ping/ping.c
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,6 @@ main(int argc, char **argv)
.ni.subject_type = -1,
};
unsigned char buf[sizeof(struct in6_addr)];
struct in6_addr a6;

/* FIXME: global_rts will be removed in future */
global_rts = &rts;
Expand Down Expand Up @@ -621,14 +620,6 @@ main(int argc, char **argv)
hints.ai_socktype = SOCK_RAW;
}

if (inet_pton(AF_INET6, target, &a6) && IN6_IS_ADDR_V4MAPPED(&a6)) {
target = strrchr(target, ':') + 1;
hints.ai_family = AF_INET;

if (rts.opt_verbose)
error(0, 0, _("IPv4-Mapped-in-IPv6 address, using IPv4 %s"), target);
}

if (hints.ai_family != AF_INET6) {
create_socket(&rts, &sock4, AF_INET, hints.ai_socktype, IPPROTO_ICMP,
hints.ai_family == AF_INET);
Expand Down

0 comments on commit 777868c

Please sign in to comment.