netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ipv6: fix route error binding peer in func icmp6_dst_alloc
@ 2011-10-28 12:46 Gao feng
  2011-10-28 20:36 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Gao feng @ 2011-10-28 12:46 UTC (permalink / raw)
  To: davem, eric.dumazet; +Cc: netdev, gaofeng, Gao feng

in func icmp6_dst_alloc,dst_metric_set call ipv6_cow_metrics to set metric.
ipv6_cow_metrics may will call rt6_bind_peer to set rt6_info->rt6i_peer.
So,we should move ipv6_addr_copy before dst_metric_set to make sure rt6_bind_peer success.

Signed-off-by: Gao feng <gaofeng@cn.fujitsu.com>
---
 net/ipv6/route.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index fb545ed..57b82dc 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -1086,11 +1086,10 @@ struct dst_entry *icmp6_dst_alloc(struct net_device *dev,
 	rt->dst.output  = ip6_output;
 	dst_set_neighbour(&rt->dst, neigh);
 	atomic_set(&rt->dst.__refcnt, 1);
-	dst_metric_set(&rt->dst, RTAX_HOPLIMIT, 255);
-
 	ipv6_addr_copy(&rt->rt6i_dst.addr, addr);
 	rt->rt6i_dst.plen = 128;
 	rt->rt6i_idev     = idev;
+	dst_metric_set(&rt->dst, RTAX_HOPLIMIT, 255);
 
 	spin_lock_bh(&icmp6_dst_lock);
 	rt->dst.next = icmp6_dst_gc_list;
-- 
1.7.5.4

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

* Re: [PATCH] ipv6: fix route error binding peer in func icmp6_dst_alloc
  2011-10-28 12:46 [PATCH] ipv6: fix route error binding peer in func icmp6_dst_alloc Gao feng
@ 2011-10-28 20:36 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2011-10-28 20:36 UTC (permalink / raw)
  To: omarapazanadi; +Cc: eric.dumazet, netdev, gaofeng

From: Gao feng <omarapazanadi@gmail.com>
Date: Fri, 28 Oct 2011 20:46:57 +0800

> in func icmp6_dst_alloc,dst_metric_set call ipv6_cow_metrics to set metric.
> ipv6_cow_metrics may will call rt6_bind_peer to set rt6_info->rt6i_peer.
> So,we should move ipv6_addr_copy before dst_metric_set to make sure rt6_bind_peer success.
> 
> Signed-off-by: Gao feng <gaofeng@cn.fujitsu.com>

Applied, thanks.

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

end of thread, other threads:[~2011-10-28 20:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-28 12:46 [PATCH] ipv6: fix route error binding peer in func icmp6_dst_alloc Gao feng
2011-10-28 20:36 ` 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).