netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] ipv6: remove unnecessory call rt6_clean_expires
@ 2012-09-20  4:57 roy.qing.li
  2012-09-20  5:03 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: roy.qing.li @ 2012-09-20  4:57 UTC (permalink / raw)
  To: netdev, gaofeng

From: Li RongQing <roy.qing.li@gmail.com>

ip6_dst_alloc will zero the from and rt6i_flags of dst cache,
so it is unnecessory to call rt6_clean_expires again.

Cc: Gao feng <gaofeng@cn.fujitsu.com>
Signed-off-by: Li RongQing <roy.qing.li@gmail.com>
---
 net/ipv6/route.c |    9 ++-------
 1 files changed, 2 insertions(+), 7 deletions(-)

diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index 0607ee3..fd5dabf 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -996,8 +996,7 @@ struct dst_entry *ip6_blackhole_route(struct net *net, struct dst_entry *dst_ori
 			in6_dev_hold(rt->rt6i_idev);
 
 		rt->rt6i_gateway = ort->rt6i_gateway;
-		rt->rt6i_flags = ort->rt6i_flags;
-		rt6_clean_expires(rt);
+		rt->rt6i_flags = ort->rt6i_flags & ~RTF_EXPIRES;
 		rt->rt6i_metric = 0;
 
 		memcpy(&rt->rt6i_dst, &ort->rt6i_dst, sizeof(struct rt6key));
@@ -1393,8 +1392,6 @@ int ip6_route_add(struct fib6_config *cfg)
 	if (cfg->fc_flags & RTF_EXPIRES)
 		rt6_set_expires(rt, jiffies +
 				clock_t_to_jiffies(cfg->fc_expires));
-	else
-		rt6_clean_expires(rt);
 
 	if (cfg->fc_protocol == RTPROT_UNSPEC)
 		cfg->fc_protocol = RTPROT_BOOT;
@@ -1803,12 +1800,10 @@ static struct rt6_info *ip6_rt_copy(struct rt6_info *ort,
 		rt->dst.lastuse = jiffies;
 
 		rt->rt6i_gateway = ort->rt6i_gateway;
-		rt->rt6i_flags = ort->rt6i_flags;
+		rt->rt6i_flags = ort->rt6i_flags & ~RTF_EXPIRES;
 		if ((ort->rt6i_flags & (RTF_DEFAULT | RTF_ADDRCONF)) ==
 		    (RTF_DEFAULT | RTF_ADDRCONF))
 			rt6_set_from(rt, ort);
-		else
-			rt6_clean_expires(rt);
 		rt->rt6i_metric = 0;
 
 #ifdef CONFIG_IPV6_SUBTREES
-- 
1.7.4.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH net-next] ipv6: remove unnecessory call rt6_clean_expires
  2012-09-20  4:57 [PATCH net-next] ipv6: remove unnecessory call rt6_clean_expires roy.qing.li
@ 2012-09-20  5:03 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2012-09-20  5:03 UTC (permalink / raw)
  To: roy.qing.li; +Cc: netdev, gaofeng

From: roy.qing.li@gmail.com
Date: Thu, 20 Sep 2012 12:57:33 +0800

> From: Li RongQing <roy.qing.li@gmail.com>
> 
> ip6_dst_alloc will zero the from and rt6i_flags of dst cache,
> so it is unnecessory to call rt6_clean_expires again.
> 
> Cc: Gao feng <gaofeng@cn.fujitsu.com>
> Signed-off-by: Li RongQing <roy.qing.li@gmail.com>

You're modifying ip6_blackhole_route() and ip6_route_add().

Only the latter calls ip6_dst_alloc().

I know the change is OK, but your commit message is extremely
inaccurate, please fix it.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-09-20  5:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-20  4:57 [PATCH net-next] ipv6: remove unnecessory call rt6_clean_expires roy.qing.li
2012-09-20  5:03 ` 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).