Discussion:
ping6 with ipv4 mapped ipv6 address
(too old to reply)
Ritesh Agrawal
2012-01-06 14:12:08 UTC
Permalink
Hello,

I was trying to configure IPv4 mapped IPv6 address on NetBSD and tried
local ping using ping6 for localhost and also directly connected system.

I have turned "v6only" sysctl off i.e. "net.inet6.ip6.v6only = 0". My
interface configuration looks like:

vlan2: flags=c843<UP,BROADCAST,RUNNING,SIMPLEX,LINK2,MULTICAST> mtu 1500
capabilities=7ff80<TSO4,IP4CSUM_Rx,IP4CSUM_Tx,TCP4CSUM_Rx,TCP4CSUM_Tx,UDP4CSUM_Rx,UDP4CSUM_Tx,TCP6CSUM_Rx,TCP6CSUM_Tx,UDP6CSUM_Rx,UDP6CSUM_Tx,TSO6>
enabled=3ff00<IP4CSUM_Rx,IP4CSUM_Tx,TCP4CSUM_Rx,TCP4CSUM_Tx,UDP4CSUM_Rx,UDP4CSUM_Tx,TCP6CSUM_Rx,TCP6CSUM_Tx,UDP6CSUM_Rx,UDP6CSUM_Tx>
vlan: 2 parent: agr0
address: 00:30:48:bb:6b:28
inet 192.168.15.156 netmask 0xffffff00 broadcast 192.168.15.255
inet6 fe80::230:48ff:febb:6b28%vlan2 prefixlen 64 scopeid 0x6
inet6 ::ffff:192.168.15.156 prefixlen 120

now if I try do to "ping6 ::ffff:192.168.15.156" it reports
"ping6: UDP connect: Invalid argument"
But if I do "telnet ::ffff:192.168.15.156 22" works fine for me.

I looked at in6_pcbind and it is failing for "if (in6p->in6p_lport ||
!IN6_IS_ADDR_UNSPECIFIED(&in6p->in6p_laddr))" check.

Do you think it is not allowed to do ping6 for IPv4 mapped IPv6 address?
I tried on Linux system and it works great on it. For localhost it
responds locally and for locally connected system it sends out "ICMP6
echo request" message. For TCP based connection IPv4 connection is
established between host.

Thanks
Ritesh


--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Ignatios Souvatzis
2012-01-06 15:10:48 UTC
Permalink
Hello,
Post by Ritesh Agrawal
Do you think it is not allowed to do ping6 for IPv4 mapped IPv6 address?
Yes, I think so.

You should be aware that IPv4 mapped IPv6 is still IPv4 - it's only
presented in a IPv6-resembling text format (or actually, when calling
your operating system's libraries or kernel, binary socket address
format.)

For dual-protocol applications this is no problem - they know how
to switch (implicitly, when using the right (modern) library calls).

However, ping6 (and traceroute6) don't only use the modern calls, but
also some very special ones; while old ping and traceroute for IPv4
need to hand-craft the IPv4 packets. (They use very special packets
after all!

It would be quite some effort to unify those programs with the IPv4
counterparts; and this would hide the differences which really are
there. Given that those are _analysis_ tools, not user applications, I
think that's not only acceptable, but even slightly better so (no
danger to confuse a working v6 with a broken v4 connectivity or
vice versa).

I understand this is a matter of taste.

Regards,
-is

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Loading...