diff options
author | YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> | 2005-12-21 08:56:42 -0500 |
---|---|---|
committer | YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> | 2005-12-21 08:56:42 -0500 |
commit | 58c4fb86eabcbc385d954843a635b7f4327be6b0 (patch) | |
tree | 86d6b7401208248716493a3ddef63b034ae69510 /net/ipv6/route.c | |
parent | bb44f116a14c4c932f15c79acfafd46bcb43ca9a (diff) |
[IPV6]: Flag RTF_ANYCAST for anycast routes.
Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Diffstat (limited to 'net/ipv6/route.c')
-rw-r--r-- | net/ipv6/route.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/net/ipv6/route.c b/net/ipv6/route.c index 7c68bfbee361..66140f13d119 100644 --- a/net/ipv6/route.c +++ b/net/ipv6/route.c | |||
@@ -413,11 +413,14 @@ static struct rt6_info *rt6_cow(struct rt6_info *ort, struct in6_addr *daddr, | |||
413 | rt = ip6_rt_copy(ort); | 413 | rt = ip6_rt_copy(ort); |
414 | 414 | ||
415 | if (rt) { | 415 | if (rt) { |
416 | ipv6_addr_copy(&rt->rt6i_dst.addr, daddr); | 416 | if (!(rt->rt6i_flags&RTF_GATEWAY)) { |
417 | 417 | if (rt->rt6i_dst.plen != 128 && | |
418 | if (!(rt->rt6i_flags&RTF_GATEWAY)) | 418 | ipv6_addr_equal(&rt->rt6i_dst.addr, daddr)) |
419 | rt->rt6i_flags |= RTF_ANYCAST; | ||
419 | ipv6_addr_copy(&rt->rt6i_gateway, daddr); | 420 | ipv6_addr_copy(&rt->rt6i_gateway, daddr); |
421 | } | ||
420 | 422 | ||
423 | ipv6_addr_copy(&rt->rt6i_dst.addr, daddr); | ||
421 | rt->rt6i_dst.plen = 128; | 424 | rt->rt6i_dst.plen = 128; |
422 | rt->rt6i_flags |= RTF_CACHE; | 425 | rt->rt6i_flags |= RTF_CACHE; |
423 | rt->u.dst.flags |= DST_HOST; | 426 | rt->u.dst.flags |= DST_HOST; |
@@ -1413,7 +1416,9 @@ struct rt6_info *addrconf_dst_alloc(struct inet6_dev *idev, | |||
1413 | rt->u.dst.obsolete = -1; | 1416 | rt->u.dst.obsolete = -1; |
1414 | 1417 | ||
1415 | rt->rt6i_flags = RTF_UP | RTF_NONEXTHOP; | 1418 | rt->rt6i_flags = RTF_UP | RTF_NONEXTHOP; |
1416 | if (!anycast) | 1419 | if (anycast) |
1420 | rt->rt6i_flags |= RTF_ANYCAST; | ||
1421 | else | ||
1417 | rt->rt6i_flags |= RTF_LOCAL; | 1422 | rt->rt6i_flags |= RTF_LOCAL; |
1418 | rt->rt6i_nexthop = ndisc_get_neigh(rt->rt6i_dev, &rt->rt6i_gateway); | 1423 | rt->rt6i_nexthop = ndisc_get_neigh(rt->rt6i_dev, &rt->rt6i_gateway); |
1419 | if (rt->rt6i_nexthop == NULL) { | 1424 | if (rt->rt6i_nexthop == NULL) { |