* [PATCH] ipv6: drop the judgement in rt6_alloc_cow()
@ 2013-11-05 5:34 Duan Jiong
2013-11-05 21:23 ` Hannes Frederic Sowa
0 siblings, 1 reply; 3+ messages in thread
From: Duan Jiong @ 2013-11-05 5:34 UTC (permalink / raw)
To: David Miller; +Cc: netdev
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>
---
net/ipv6/route.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index fd399ac..c28cdda 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,
rt = ip6_rt_copy(ort, daddr);
if (rt) {
- if (!(rt->rt6i_flags & RTF_GATEWAY)) {
- if (ort->rt6i_dst.plen != 128 &&
- ipv6_addr_equal(&ort->rt6i_dst.addr, daddr))
- rt->rt6i_flags |= RTF_ANYCAST;
- }
+ if (ort->rt6i_dst.plen != 128 &&
+ ipv6_addr_equal(&ort->rt6i_dst.addr, daddr))
+ rt->rt6i_flags |= RTF_ANYCAST;
rt->rt6i_flags |= RTF_CACHE;
--
1.8.3.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] ipv6: drop the judgement in rt6_alloc_cow()
2013-11-05 5:34 [PATCH] ipv6: drop the judgement in rt6_alloc_cow() Duan Jiong
@ 2013-11-05 21:23 ` Hannes Frederic Sowa
2013-11-06 3:17 ` David Miller
0 siblings, 1 reply; 3+ messages in thread
From: Hannes Frederic Sowa @ 2013-11-05 21:23 UTC (permalink / raw)
To: Duan Jiong; +Cc: David Miller, netdev
On Tue, Nov 05, 2013 at 01:34:53PM +0800, Duan Jiong wrote:
>
> 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.
This is ok.
Acked-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
Thanks,
Hannes
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] ipv6: drop the judgement in rt6_alloc_cow()
2013-11-05 21:23 ` Hannes Frederic Sowa
@ 2013-11-06 3:17 ` David Miller
0 siblings, 0 replies; 3+ messages in thread
From: David Miller @ 2013-11-06 3:17 UTC (permalink / raw)
To: hannes; +Cc: duanj.fnst, netdev
From: Hannes Frederic Sowa <hannes@stressinduktion.org>
Date: Tue, 5 Nov 2013 22:23:44 +0100
> On Tue, Nov 05, 2013 at 01:34:53PM +0800, Duan Jiong wrote:
>>
>> 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.
>
> This is ok.
>
> Acked-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
Applied, thanks everyone.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-11-06 3:17 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-05 5:34 [PATCH] ipv6: drop the judgement in rt6_alloc_cow() Duan Jiong
2013-11-05 21:23 ` Hannes Frederic Sowa
2013-11-06 3:17 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).