From patchwork Mon Apr 12 15:41:32 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: stephen hemminger X-Patchwork-Id: 49971 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 0691AB7C33 for ; Tue, 13 Apr 2010 01:46:47 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752534Ab0DLPqm (ORCPT ); Mon, 12 Apr 2010 11:46:42 -0400 Received: from suva.vyatta.com ([76.74.103.44]:47330 "EHLO suva.vyatta.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751388Ab0DLPql (ORCPT ); Mon, 12 Apr 2010 11:46:41 -0400 Received: from suva.vyatta.com (suva [127.0.0.1]) by suva.vyatta.com (8.13.7/8.13.7) with ESMTP id o3CFka3I012484; Mon, 12 Apr 2010 08:46:36 -0700 Received: (from shemminger@localhost) by suva.vyatta.com (8.13.7/8.13.7/Submit) id o3CFkadR012483; Mon, 12 Apr 2010 08:46:36 -0700 Message-Id: <20100412154255.722417369@vyatta.com> References: <20100412154130.397252857@vyatta.com> User-Agent: quilt/0.46-1 Date: Mon, 12 Apr 2010 08:41:32 -0700 From: Stephen Hemminger To: davem@davemloft.net Cc: netdev@vger.kernel.org Subject: [PATCH 2/4] IPv6: keep tentative addresses in hash table Content-Disposition: inline; filename=ipv6-addrconf2.patch Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org When link goes down, want address to be preserved but in a tentative state, therefore it has to stay in hash list. Signed-off-by: Stephen Hemminger --- a/net/ipv6/addrconf.c 2010-04-11 12:25:05.349309074 -0700 +++ b/net/ipv6/addrconf.c 2010-04-11 12:25:10.408996382 -0700 @@ -2703,17 +2703,18 @@ static int addrconf_ifdown(struct net_de /* Flag it for later restoration when link comes up */ ifa->flags |= IFA_F_TENTATIVE; in6_ifa_hold(ifa); + write_unlock_bh(&idev->lock); } else { list_del(&ifa->if_list); ifa->dead = 1; - } - write_unlock_bh(&idev->lock); + write_unlock_bh(&idev->lock); - /* clear hash table */ - spin_lock_bh(&addrconf_hash_lock); - hlist_del_init_rcu(&ifa->addr_lst); - __in6_ifa_put(ifa); - spin_unlock_bh(&addrconf_hash_lock); + /* clear hash table */ + spin_lock_bh(&addrconf_hash_lock); + hlist_del_init_rcu(&ifa->addr_lst); + __in6_ifa_put(ifa); + spin_unlock_bh(&addrconf_hash_lock); + } __ipv6_ifa_notify(RTM_DELADDR, ifa); atomic_notifier_call_chain(&inet6addr_chain, NETDEV_DOWN, ifa);