From patchwork Fri Oct 28 12:46:57 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gao feng X-Patchwork-Id: 122402 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 0A14D1007DB for ; Fri, 28 Oct 2011 23:47:17 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755640Ab1J1MrL (ORCPT ); Fri, 28 Oct 2011 08:47:11 -0400 Received: from mail-qw0-f46.google.com ([209.85.216.46]:54057 "EHLO mail-qw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753241Ab1J1MrJ (ORCPT ); Fri, 28 Oct 2011 08:47:09 -0400 Received: by qabj40 with SMTP id j40so3614743qab.19 for ; Fri, 28 Oct 2011 05:47:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer; bh=hfiou+PhwOQftH4NrjnRtXE84XAxAd8dTyGu4EW5HU8=; b=eM2i+anJl13V+wvVefJkjmURMKDtL7q+yMFN0M3bNIHJaXzQ/Cg8uYlav7D/RO1gGZ mjd4at4vyJkLBzMxi9Y7DTx5OeTBKQ0Yg53NaHLxhbbO5AI4LHsCstAawztEM65eyDNM OHjEDPD93S9uPRXC3q4p6oAaooJpkkfBmAnoM= Received: by 10.224.180.207 with SMTP id bv15mr2436404qab.36.1319806029005; Fri, 28 Oct 2011 05:47:09 -0700 (PDT) Received: from localhost.localdomain ([216.213.99.218]) by mx.google.com with ESMTPS id f8sm14041963qap.15.2011.10.28.05.47.05 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 28 Oct 2011 05:47:08 -0700 (PDT) From: Gao feng To: davem@davemloft.net, eric.dumazet@gmail.com Cc: netdev@vger.kernel.org, gaofeng@cn.fujitsu.com, Gao feng Subject: [PATCH] ipv6: fix route error binding peer in func icmp6_dst_alloc Date: Fri, 28 Oct 2011 20:46:57 +0800 Message-Id: <1319806017-6131-1-git-send-email-omarapazanadi@gmail.com> X-Mailer: git-send-email 1.7.5.4 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org 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 --- 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;