diff options
author | YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> | 2005-12-21 08:57:06 -0500 |
---|---|---|
committer | YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> | 2005-12-21 08:57:06 -0500 |
commit | 8de3351e6e0a1081fbf6864ae37839e327699a08 (patch) | |
tree | 83f2a001101dee12de37542f554c255cd5dbf18e /net/ipv6 | |
parent | 58c4fb86eabcbc385d954843a635b7f4327be6b0 (diff) |
[IPV6]: Try not to send icmp to anycast address.
Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Diffstat (limited to 'net/ipv6')
-rw-r--r-- | net/ipv6/icmp.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/net/ipv6/icmp.c b/net/ipv6/icmp.c index 34a332225c17..6ec6a2b549bb 100644 --- a/net/ipv6/icmp.c +++ b/net/ipv6/icmp.c | |||
@@ -328,8 +328,10 @@ void icmpv6_send(struct sk_buff *skb, int type, int code, __u32 info, | |||
328 | iif = skb->dev->ifindex; | 328 | iif = skb->dev->ifindex; |
329 | 329 | ||
330 | /* | 330 | /* |
331 | * Must not send if we know that source is Anycast also. | 331 | * Must not send error if the source does not uniquely |
332 | * for now we don't know that. | 332 | * identify a single node (RFC2463 Section 2.4). |
333 | * We check unspecified / multicast addresses here, | ||
334 | * and anycast addresses will be checked later. | ||
333 | */ | 335 | */ |
334 | if ((addr_type == IPV6_ADDR_ANY) || (addr_type & IPV6_ADDR_MULTICAST)) { | 336 | if ((addr_type == IPV6_ADDR_ANY) || (addr_type & IPV6_ADDR_MULTICAST)) { |
335 | LIMIT_NETDEBUG(KERN_DEBUG "icmpv6_send: addr_any/mcast source\n"); | 337 | LIMIT_NETDEBUG(KERN_DEBUG "icmpv6_send: addr_any/mcast source\n"); |
@@ -373,6 +375,16 @@ void icmpv6_send(struct sk_buff *skb, int type, int code, __u32 info, | |||
373 | err = ip6_dst_lookup(sk, &dst, &fl); | 375 | err = ip6_dst_lookup(sk, &dst, &fl); |
374 | if (err) | 376 | if (err) |
375 | goto out; | 377 | goto out; |
378 | |||
379 | /* | ||
380 | * We won't send icmp if the destination is known | ||
381 | * anycast. | ||
382 | */ | ||
383 | if (((struct rt6_info *)dst)->rt6i_flags & RTF_ANYCAST) { | ||
384 | LIMIT_NETDEBUG(KERN_DEBUG "icmpv6_send: acast source\n"); | ||
385 | goto out_dst_release; | ||
386 | } | ||
387 | |||
376 | if ((err = xfrm_lookup(&dst, &fl, sk, 0)) < 0) | 388 | if ((err = xfrm_lookup(&dst, &fl, sk, 0)) < 0) |
377 | goto out; | 389 | goto out; |
378 | 390 | ||