aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6/icmp.c
diff options
context:
space:
mode:
authorFX Le Bail <fx.lebail@yahoo.com>2014-01-07 08:57:27 -0500
committerDavid S. Miller <davem@davemloft.net>2014-01-07 15:51:39 -0500
commit509aba3b0d366b7f16a9a2eebac1156b25f5f622 (patch)
tree703f6a9807c1cc5f2ae451831f4ffe7eb2861baf /net/ipv6/icmp.c
parent9ba75fb0c4b92416b94640b5a043c323a457f14a (diff)
IPv6: add the option to use anycast addresses as source addresses in echo reply
This change allows to follow a recommandation of RFC4942. - Add "anycast_src_echo_reply" sysctl to control the use of anycast addresses as source addresses for ICMPv6 echo reply. This sysctl is false by default to preserve existing behavior. - Add inline check ipv6_anycast_destination(). - Use them in icmpv6_echo_reply(). Reference: RFC4942 - IPv6 Transition/Coexistence Security Considerations (http://tools.ietf.org/html/rfc4942#section-2.1.6) 2.1.6. Anycast Traffic Identification and Security [...] To avoid exposing knowledge about the internal structure of the network, it is recommended that anycast servers now take advantage of the ability to return responses with the anycast address as the source address if possible. Signed-off-by: Francois-Xavier Le Bail <fx.lebail@yahoo.com> Acked-by: Hannes Frederic Sowa <hannes@stressinduktion.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6/icmp.c')
-rw-r--r--net/ipv6/icmp.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/net/ipv6/icmp.c b/net/ipv6/icmp.c
index 5d420095190f..9a809a4b3d86 100644
--- a/net/ipv6/icmp.c
+++ b/net/ipv6/icmp.c
@@ -556,7 +556,9 @@ static void icmpv6_echo_reply(struct sk_buff *skb)
556 556
557 saddr = &ipv6_hdr(skb)->daddr; 557 saddr = &ipv6_hdr(skb)->daddr;
558 558
559 if (!ipv6_unicast_destination(skb)) 559 if (!ipv6_unicast_destination(skb) &&
560 !(net->ipv6.anycast_src_echo_reply &&
561 ipv6_anycast_destination(skb)))
560 saddr = NULL; 562 saddr = NULL;
561 563
562 memcpy(&tmp_hdr, icmph, sizeof(tmp_hdr)); 564 memcpy(&tmp_hdr, icmph, sizeof(tmp_hdr));