aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6/route.c
diff options
context:
space:
mode:
authorGao feng <omarapazanadi@gmail.com>2011-10-27 22:46:57 -0400
committerDavid S. Miller <davem@davemloft.net>2011-10-28 16:36:07 -0400
commit7011687f0f2f12cc348f6a693fafe63d89167eac (patch)
treec5e546044c5ff88b4abafc28df19e8b7ba951a7e /net/ipv6/route.c
parent504744e4edc24f6f16eed44a59b39bffcc0c1391 (diff)
ipv6: fix route error binding peer in func icmp6_dst_alloc
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> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6/route.c')
-rw-r--r--net/ipv6/route.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index fb545edef6ea..57b82dc1ae91 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,
1086 rt->dst.output = ip6_output; 1086 rt->dst.output = ip6_output;
1087 dst_set_neighbour(&rt->dst, neigh); 1087 dst_set_neighbour(&rt->dst, neigh);
1088 atomic_set(&rt->dst.__refcnt, 1); 1088 atomic_set(&rt->dst.__refcnt, 1);
1089 dst_metric_set(&rt->dst, RTAX_HOPLIMIT, 255);
1090
1091 ipv6_addr_copy(&rt->rt6i_dst.addr, addr); 1089 ipv6_addr_copy(&rt->rt6i_dst.addr, addr);
1092 rt->rt6i_dst.plen = 128; 1090 rt->rt6i_dst.plen = 128;
1093 rt->rt6i_idev = idev; 1091 rt->rt6i_idev = idev;
1092 dst_metric_set(&rt->dst, RTAX_HOPLIMIT, 255);
1094 1093
1095 spin_lock_bh(&icmp6_dst_lock); 1094 spin_lock_bh(&icmp6_dst_lock);
1096 rt->dst.next = icmp6_dst_gc_list; 1095 rt->dst.next = icmp6_dst_gc_list;