From patchwork Mon Jan 28 17:20:52 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: bonding: unset primary slave via sysfs Date: Mon, 28 Jan 2013 07:20:52 -0000 From: Milos Vyletel X-Patchwork-Id: 216264 Message-Id: <1359393652-2804-1-git-send-email-milos.vyletel@sde.cz> To: netdev@vger.kernel.org Cc: fubar@us.ibm.com, andy@greyhouse.net, Milos Vyletel When bonding module is loaded with primary parameter and one decides to unset primary slave using sysfs these settings are not preserved during bond device restart. Primary slave is only unset once and it's not remembered in bond->params structure. Signed-off-by: Milos Vyletel Reviewed-by: Jiri Pirko Signed-off-by: Jay Vosburgh --- drivers/net/bonding/bond_sysfs.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/drivers/net/bonding/bond_sysfs.c b/drivers/net/bonding/bond_sysfs.c index ef8d2a0..155f3b4 100644 --- a/drivers/net/bonding/bond_sysfs.c +++ b/drivers/net/bonding/bond_sysfs.c @@ -1067,6 +1067,7 @@ static ssize_t bonding_store_primary(struct device *d, pr_info("%s: Setting primary slave to None.\n", bond->dev->name); bond->primary_slave = NULL; + memset(bond->params.primary, 0, sizeof(bond->params.primary)); bond_select_active_slave(bond); goto out; }