Received: with ECARTIS (v1.0.0; list netdev); Fri, 01 Jul 2005 13:52:18 -0700 (PDT) Received: from orsfmr002.jf.intel.com (fmr17.intel.com [134.134.136.16]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with ESMTP id j61KqFH9009088 for ; Fri, 1 Jul 2005 13:52:15 -0700 Received: from orsfmr100.jf.intel.com (orsfmr100.jf.intel.com [10.7.209.16]) by orsfmr002.jf.intel.com (8.12.10/8.12.10/d: major-outer.mc,v 1.1 2004/09/17 17:50:56 root Exp $) with ESMTP id j61Kodq8022675; Fri, 1 Jul 2005 20:50:39 GMT Received: from nwlxmail01.jf.intel.com (nwlxmail01.jf.intel.com [10.7.171.40]) by orsfmr100.jf.intel.com (8.12.10/8.12.10/d: major-inner.mc,v 1.2 2004/09/17 18:05:01 root Exp $) with ESMTP id j61KodPb002162; Fri, 1 Jul 2005 20:50:39 GMT Received: from [134.134.3.92] ([134.134.3.92]) by nwlxmail01.jf.intel.com (8.12.10/8.12.9/MailSET/Hub) with ESMTP id j61KodSL003725; Fri, 1 Jul 2005 13:50:39 -0700 Date: Fri, 1 Jul 2005 13:49:52 -0700 (PDT) From: Radheka Godse X-X-Sender: radheka@localhost.localdomain To: fubar@us.ibm.com, bonding-devel@lists.sourceforge.net cc: netdev@oss.sgi.com Subject: [PATCH 2.6.13-rc1 9/17] bonding: get primary name from slave dev Message-ID: ReplyTo: "Radheka Godse" MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Scanned-By: MIMEDefang 2.44 X-archive-position: 2600 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: radheka.godse@intel.com Precedence: bulk X-list: netdev This patch fixes a bug in the proc file handler in bonding. The name of the primary slave was taken from the command-line options, instead of from the dev structure of the primary slave itself. This caused an incorrect dispaly if t he primary is set or changed via sysfs. Signed-off-by: Radheka Godse Signed-off-by: Mitch Williams diff -urN -X dontdiff linux-2.6.12post/drivers/net/bonding/bond_main.c linux-2.6.12post-sysfs/drivers/net/bonding/bond_main.c --- linux-2.6.12post/drivers/net/bonding/bond_main.c 2005-06-28 18:18:03.000000000 -0700 +++ linux-2.6.12post-sysfs/drivers/net/bonding/bond_main.c 2005-06-30 13:53:55.000000000 -0700 @@ -3369,8 +3369,8 @@ if (USES_PRIMARY(bond->params.mode)) { seq_printf(seq, "Primary Slave: %s\n", - (bond->params.primary[0]) ? - bond->params.primary : "None"); + (bond->primary_slave) ? + bond->primary_slave->dev->name : "None"); seq_printf(seq, "Currently Active Slave: %s\n", (curr) ? curr->dev->name : "None");