summary refs log tree commit diff
path: root/drivers/net/bonding/bond_netlink.c
diff options
context:
space:
mode:
authorNikolay Aleksandrov <nikolay@redhat.com>2014-01-22 14:53:35 +0100
committerDavid S. Miller <davem@davemloft.net>2014-01-22 15:38:44 -0800
commitd1fbd3ed9366904b58b1c0c30b22d51dc793de99 (patch)
treea49cee5fd1ba6b4d063a4c63b34a95ecabf851be /drivers/net/bonding/bond_netlink.c
parent0fff060877426f3faf6754c201e28cd5b34756c0 (diff)
downloadlinux-d1fbd3ed9366904b58b1c0c30b22d51dc793de99.tar.gz
bonding: convert active_slave to use the new option API
This patch adds the necessary changes so active_slave would use
the new bonding option API. Also some trivial/style fixes.

Signed-off-by: Nikolay Aleksandrov <nikolay@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/bonding/bond_netlink.c')
-rw-r--r--drivers/net/bonding/bond_netlink.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/net/bonding/bond_netlink.c b/drivers/net/bonding/bond_netlink.c
index 2175e1926e5a..dba1f2e22371 100644
--- a/drivers/net/bonding/bond_netlink.c
+++ b/drivers/net/bonding/bond_netlink.c
@@ -116,16 +116,17 @@ static int bond_changelink(struct net_device *bond_dev,
 	if (data[IFLA_BOND_ACTIVE_SLAVE]) {
 		int ifindex = nla_get_u32(data[IFLA_BOND_ACTIVE_SLAVE]);
 		struct net_device *slave_dev;
+		char *active_slave = "";
 
-		if (ifindex == 0) {
-			slave_dev = NULL;
-		} else {
+		if (ifindex != 0) {
 			slave_dev = __dev_get_by_index(dev_net(bond_dev),
 						       ifindex);
 			if (!slave_dev)
 				return -ENODEV;
+			active_slave = slave_dev->name;
 		}
-		err = bond_option_active_slave_set(bond, slave_dev);
+		bond_opt_initstr(&newval, active_slave);
+		err = __bond_opt_set(bond, BOND_OPT_ACTIVE_SLAVE, &newval);
 		if (err)
 			return err;
 	}