net: ipv6: Add IPv6 support to the ping socket.
authorLorenzo Colitti <lorenzo@google.com>
Wed, 16 Jan 2013 22:09:49 +0000 (22:09 +0000)
committerGabby Lee <galee@nvidia.com>
Fri, 10 Jan 2014 01:51:02 +0000 (17:51 -0800)
commit9d390ec2481ebbbf49ba69af07150bb6eb187f35
tree2be9d90a70b10da9888100f20bae9f3669923ba0
parent36a0aecac360a89a88306d22b7578d2ae14ba9be
net: ipv6: Add IPv6 support to the ping socket.

[backport of net-next 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 1412141

Change-Id: I0081b4654dd54b12c8f233e00e18943582aa2142
Signed-off-by: Lorenzo Colitti <lorenzo@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
[lorenzo@google.com: backported to 3.4]
(cherry picked from commit 1f0675844e3b63a765e5bd32bc5af051ccd951c0)
Reviewed-on: http://git-master/r/336269
(cherry picked from commit 36c1b848f9c0cbcefa6fc731f84ae6ddc3536be6)
Signed-off-by: Lorenzo Colitti <lorenzo@google.com>
Reviewed-on: http://git-master/r/353230
Reviewed-by: Nitin Bindal <nbindal@nvidia.com>
Tested-by: Nitin Bindal <nbindal@nvidia.com>
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
include/net/ipv6.h
include/net/ping.h
include/net/transp_v6.h
net/ipv4/af_inet.c
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]