net: ipv6: Add IPv6 support to the ping socket.
authorLorenzo Colitti <lorenzo@google.com>
Wed, 22 May 2013 20:17:31 +0000 (20:17 +0000)
committerLorenzo Colitti <lorenzo@google.com>
Thu, 30 Jan 2014 19:39:32 +0000 (11:39 -0800)
commitfd762f67b3508e44804d7d7d91532292cb3b113b
tree54585bc7733485354261b628b9ff0fafde95a9b2
parentd4e564429cb89a90b9d5482af884b0b6a85aa284
net: ipv6: Add IPv6 support to the ping socket.

[net-next commit 6d0bfe22611602f36617bc7aa2ffa1bbb2f54c67]

This adds the ability to send ICMPv6 echo requests without a
raw socket. The equivalent ability for ICMPv4 was added in
2011.

Instead of having separate code paths for IPv4 and IPv6, make
most of the code in net/ipv4/ping.c dual-stack and only add a
few IPv6-specific bits (like the protocol definition) to a new
net/ipv6/ping.c. Hopefully this will reduce divergence and/or
duplication of bugs in the future.

Caveats:

- Setting options via ancillary data (e.g., using IPV6_PKTINFO
  to specify the outgoing interface) is not yet supported.
- There are no separate security settings for IPv4 and IPv6;
  everything is controlled by /proc/net/ipv4/ping_group_range.
- The proc interface does not yet display IPv6 ping sockets
  properly.

Tested with a patched copy of ping6 and using raw socket calls.
Compiles and works with all of CONFIG_IPV6={n,m,y}.

Bug: 12800827
Change-Id: I718cd9931823873ab44df22e8a66e12d6a0a6eb1
Signed-off-by: Lorenzo Colitti <lorenzo@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/ipv6.h
include/net/ping.h
include/net/transp_v6.h
net/ipv4/icmp.c
net/ipv4/ping.c
net/ipv6/Makefile
net/ipv6/af_inet6.c
net/ipv6/icmp.c
net/ipv6/ping.c [new file with mode: 0644]