diff options
author | FX Le Bail <fx.lebail@yahoo.com> | 2014-01-07 08:57:27 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-01-07 15:51:39 -0500 |
commit | 509aba3b0d366b7f16a9a2eebac1156b25f5f622 (patch) | |
tree | 703f6a9807c1cc5f2ae451831f4ffe7eb2861baf /include/net/ip6_route.h | |
parent | 9ba75fb0c4b92416b94640b5a043c323a457f14a (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 'include/net/ip6_route.h')
-rw-r--r-- | include/net/ip6_route.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/net/ip6_route.h b/include/net/ip6_route.h index 1fb6cddbd448..017badb1aec7 100644 --- a/include/net/ip6_route.h +++ b/include/net/ip6_route.h | |||
@@ -152,6 +152,13 @@ static inline bool ipv6_unicast_destination(const struct sk_buff *skb) | |||
152 | return rt->rt6i_flags & RTF_LOCAL; | 152 | return rt->rt6i_flags & RTF_LOCAL; |
153 | } | 153 | } |
154 | 154 | ||
155 | static inline bool ipv6_anycast_destination(const struct sk_buff *skb) | ||
156 | { | ||
157 | struct rt6_info *rt = (struct rt6_info *) skb_dst(skb); | ||
158 | |||
159 | return rt->rt6i_flags & RTF_ANYCAST; | ||
160 | } | ||
161 | |||
155 | int ip6_fragment(struct sk_buff *skb, int (*output)(struct sk_buff *)); | 162 | int ip6_fragment(struct sk_buff *skb, int (*output)(struct sk_buff *)); |
156 | 163 | ||
157 | static inline int ip6_skb_dst_mtu(struct sk_buff *skb) | 164 | static inline int ip6_skb_dst_mtu(struct sk_buff *skb) |