aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/bonding/bond_sysfs.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/bonding/bond_sysfs.c')
-rw-r--r--drivers/net/bonding/bond_sysfs.c23
1 files changed, 9 insertions, 14 deletions
diff --git a/drivers/net/bonding/bond_sysfs.c b/drivers/net/bonding/bond_sysfs.c
index 8fd0174c5380..de87aea6d01a 100644
--- a/drivers/net/bonding/bond_sysfs.c
+++ b/drivers/net/bonding/bond_sysfs.c
@@ -118,7 +118,10 @@ static ssize_t bonding_store_bonds(struct class *cls,
118 pr_info("%s is being created...\n", ifname); 118 pr_info("%s is being created...\n", ifname);
119 rv = bond_create(net, ifname); 119 rv = bond_create(net, ifname);
120 if (rv) { 120 if (rv) {
121 pr_info("Bond creation failed.\n"); 121 if (rv == -EEXIST)
122 pr_info("%s already exists.\n", ifname);
123 else
124 pr_info("%s creation failed.\n", ifname);
122 res = rv; 125 res = rv;
123 } 126 }
124 } else if (command[0] == '-') { 127 } else if (command[0] == '-') {
@@ -322,11 +325,6 @@ static ssize_t bonding_store_mode(struct device *d,
322 ret = -EINVAL; 325 ret = -EINVAL;
323 goto out; 326 goto out;
324 } 327 }
325 if (bond->params.mode == BOND_MODE_8023AD)
326 bond_unset_master_3ad_flags(bond);
327
328 if (bond->params.mode == BOND_MODE_ALB)
329 bond_unset_master_alb_flags(bond);
330 328
331 bond->params.mode = new_value; 329 bond->params.mode = new_value;
332 bond_set_mode_ops(bond, bond->params.mode); 330 bond_set_mode_ops(bond, bond->params.mode);
@@ -527,8 +525,6 @@ static ssize_t bonding_store_arp_interval(struct device *d,
527 pr_info("%s: Setting ARP monitoring interval to %d.\n", 525 pr_info("%s: Setting ARP monitoring interval to %d.\n",
528 bond->dev->name, new_value); 526 bond->dev->name, new_value);
529 bond->params.arp_interval = new_value; 527 bond->params.arp_interval = new_value;
530 if (bond->params.arp_interval)
531 bond->dev->priv_flags |= IFF_MASTER_ARPMON;
532 if (bond->params.miimon) { 528 if (bond->params.miimon) {
533 pr_info("%s: ARP monitoring cannot be used with MII monitoring. %s Disabling MII monitoring.\n", 529 pr_info("%s: ARP monitoring cannot be used with MII monitoring. %s Disabling MII monitoring.\n",
534 bond->dev->name, bond->dev->name); 530 bond->dev->name, bond->dev->name);
@@ -1004,7 +1000,6 @@ static ssize_t bonding_store_miimon(struct device *d,
1004 pr_info("%s: MII monitoring cannot be used with ARP monitoring. Disabling ARP monitoring...\n", 1000 pr_info("%s: MII monitoring cannot be used with ARP monitoring. Disabling ARP monitoring...\n",
1005 bond->dev->name); 1001 bond->dev->name);
1006 bond->params.arp_interval = 0; 1002 bond->params.arp_interval = 0;
1007 bond->dev->priv_flags &= ~IFF_MASTER_ARPMON;
1008 if (bond->params.arp_validate) { 1003 if (bond->params.arp_validate) {
1009 bond_unregister_arp(bond); 1004 bond_unregister_arp(bond);
1010 bond->params.arp_validate = 1005 bond->params.arp_validate =
@@ -1198,7 +1193,7 @@ static ssize_t bonding_store_carrier(struct device *d,
1198 bond->dev->name, new_value); 1193 bond->dev->name, new_value);
1199 } 1194 }
1200out: 1195out:
1201 return count; 1196 return ret;
1202} 1197}
1203static DEVICE_ATTR(use_carrier, S_IRUGO | S_IWUSR, 1198static DEVICE_ATTR(use_carrier, S_IRUGO | S_IWUSR,
1204 bonding_show_carrier, bonding_store_carrier); 1199 bonding_show_carrier, bonding_store_carrier);
@@ -1587,15 +1582,15 @@ static ssize_t bonding_store_slaves_active(struct device *d,
1587 } 1582 }
1588 1583
1589 bond_for_each_slave(bond, slave, i) { 1584 bond_for_each_slave(bond, slave, i) {
1590 if (slave->state == BOND_STATE_BACKUP) { 1585 if (!bond_is_active_slave(slave)) {
1591 if (new_value) 1586 if (new_value)
1592 slave->dev->priv_flags &= ~IFF_SLAVE_INACTIVE; 1587 slave->inactive = 0;
1593 else 1588 else
1594 slave->dev->priv_flags |= IFF_SLAVE_INACTIVE; 1589 slave->inactive = 1;
1595 } 1590 }
1596 } 1591 }
1597out: 1592out:
1598 return count; 1593 return ret;
1599} 1594}
1600static DEVICE_ATTR(all_slaves_active, S_IRUGO | S_IWUSR, 1595static DEVICE_ATTR(all_slaves_active, S_IRUGO | S_IWUSR,
1601 bonding_show_slaves_active, bonding_store_slaves_active); 1596 bonding_show_slaves_active, bonding_store_slaves_active);