diff options
author | Duan Jiong <duanj.fnst@cn.fujitsu.com> | 2013-11-05 00:34:53 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-11-05 22:17:05 -0500 |
commit | 249a3630c48e5df8f8706d4cdf90bddf2b737c5d (patch) | |
tree | 8f7f96d635d84767f66b0c236f6ab25435ff4a0a /net/ipv6 | |
parent | 0e033e04c2678dbbe74a46b23fffb7bb918c288e (diff) |
ipv6: drop the judgement in rt6_alloc_cow()
Now rt6_alloc_cow() is only called by ip6_pol_route() when
rt->rt6i_flags doesn't contain both RTF_NONEXTHOP and RTF_GATEWAY,
and rt->rt6i_flags hasn't been changed in ip6_rt_copy().
So there is no neccessary to judge whether rt->rt6i_flags contains
RTF_GATEWAY or not.
Signed-off-by: Duan Jiong <duanj.fnst@cn.fujitsu.com>
Acked-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6')
-rw-r--r-- | net/ipv6/route.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/net/ipv6/route.c b/net/ipv6/route.c index fd399ac6c1f7..c28cdda3f5db 100644 --- a/net/ipv6/route.c +++ b/net/ipv6/route.c | |||
@@ -871,11 +871,9 @@ static struct rt6_info *rt6_alloc_cow(struct rt6_info *ort, | |||
871 | rt = ip6_rt_copy(ort, daddr); | 871 | rt = ip6_rt_copy(ort, daddr); |
872 | 872 | ||
873 | if (rt) { | 873 | if (rt) { |
874 | if (!(rt->rt6i_flags & RTF_GATEWAY)) { | 874 | if (ort->rt6i_dst.plen != 128 && |
875 | if (ort->rt6i_dst.plen != 128 && | 875 | ipv6_addr_equal(&ort->rt6i_dst.addr, daddr)) |
876 | ipv6_addr_equal(&ort->rt6i_dst.addr, daddr)) | 876 | rt->rt6i_flags |= RTF_ANYCAST; |
877 | rt->rt6i_flags |= RTF_ANYCAST; | ||
878 | } | ||
879 | 877 | ||
880 | rt->rt6i_flags |= RTF_CACHE; | 878 | rt->rt6i_flags |= RTF_CACHE; |
881 | 879 | ||