Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 203948
b: refs/heads/master
c: c5cb002
h: refs/heads/master
v: v3
  • Loading branch information
Andy Gospodarek authored and David S. Miller committed Jul 31, 2010
1 parent 59110d5 commit df4d5c5
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 13 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 75f5e1c6f6cef2c201da688b2279cf15156db56d
refs/heads/master: c5cb002fb0c82a0ccaef24e002ab370165b55be7
37 changes: 25 additions & 12 deletions trunk/drivers/net/bonding/bond_sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -313,19 +313,26 @@ static ssize_t bonding_store_mode(struct device *d,
bond->dev->name, (int)strlen(buf) - 1, buf);
ret = -EINVAL;
goto out;
} else {
if (bond->params.mode == BOND_MODE_8023AD)
bond_unset_master_3ad_flags(bond);
}
if ((new_value == BOND_MODE_ALB ||
new_value == BOND_MODE_TLB) &&
bond->params.arp_interval) {
pr_err("%s: %s mode is incompatible with arp monitoring.\n",
bond->dev->name, bond_mode_tbl[new_value].modename);
ret = -EINVAL;
goto out;
}
if (bond->params.mode == BOND_MODE_8023AD)
bond_unset_master_3ad_flags(bond);

if (bond->params.mode == BOND_MODE_ALB)
bond_unset_master_alb_flags(bond);
if (bond->params.mode == BOND_MODE_ALB)
bond_unset_master_alb_flags(bond);

bond->params.mode = new_value;
bond_set_mode_ops(bond, bond->params.mode);
pr_info("%s: setting mode to %s (%d).\n",
bond->dev->name, bond_mode_tbl[new_value].modename,
new_value);
}
bond->params.mode = new_value;
bond_set_mode_ops(bond, bond->params.mode);
pr_info("%s: setting mode to %s (%d).\n",
bond->dev->name, bond_mode_tbl[new_value].modename,
new_value);
out:
return ret;
}
Expand Down Expand Up @@ -510,7 +517,13 @@ static ssize_t bonding_store_arp_interval(struct device *d,
ret = -EINVAL;
goto out;
}

if (bond->params.mode == BOND_MODE_ALB ||
bond->params.mode == BOND_MODE_TLB) {
pr_info("%s: ARP monitoring cannot be used with ALB/TLB. Only MII monitoring is supported on %s.\n",
bond->dev->name, bond->dev->name);
ret = -EINVAL;
goto out;
}
pr_info("%s: Setting ARP monitoring interval to %d.\n",
bond->dev->name, new_value);
bond->params.arp_interval = new_value;
Expand Down

0 comments on commit df4d5c5

Please sign in to comment.