diff options
author | Veaceslav Falico <vfalico@gmail.com> | 2014-07-15 07:26:01 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-07-16 01:54:49 -0400 |
commit | f54424412b6b2f64cae4d7c39d981ca14ce0052c (patch) | |
tree | a6ca97a2121679a772293dbd3228a15c21d4bf06 /drivers/net/bonding | |
parent | e4d112e4f9502083fd27f9ac1a4cd690e3f01421 (diff) |
bonding: permit enslaving interfaces without set_mac support
Currently we exit if the slave isn't the first slave, doesn't support mac
address setting and fail_over_mac isn't FOM_ACTIVE. It's wrong because we
only require ndo_set_mac_address in case bonding is in active-backup mode
and FOM isn't FOM_ACTIVE.
To fix this - only exit with an error if we're in a/b mode and have
fail_over_mac != FOM_ACTIVE.
Also, maintain current behaviour on the first slave (forcibly change fom to
FOM_ACTIVE) to not break anyone's configuration.
CC: Jay Vosburgh <j.vosburgh@gmail.com>
CC: Andy Gospodarek <andy@greyhouse.net>
Signed-off-by: Veaceslav Falico <vfalico@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/bonding')
-rw-r--r-- | drivers/net/bonding/bond_main.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index 6d3b8db882a1..d643807a8e6a 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c | |||
@@ -1302,19 +1302,20 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev) | |||
1302 | } | 1302 | } |
1303 | 1303 | ||
1304 | if (slave_ops->ndo_set_mac_address == NULL) { | 1304 | if (slave_ops->ndo_set_mac_address == NULL) { |
1305 | if (!bond_has_slaves(bond)) { | 1305 | pr_warn("%s: Warning: The slave device specified does not support setting the MAC address\n", |
1306 | pr_warn("%s: Warning: The first slave device specified does not support setting the MAC address\n", | 1306 | bond_dev->name); |
1307 | bond_dev->name); | 1307 | if (BOND_MODE(bond) == BOND_MODE_ACTIVEBACKUP && |
1308 | if (BOND_MODE(bond) == BOND_MODE_ACTIVEBACKUP) { | 1308 | bond->params.fail_over_mac != BOND_FOM_ACTIVE) { |
1309 | if (!bond_has_slaves(bond)) { | ||
1309 | bond->params.fail_over_mac = BOND_FOM_ACTIVE; | 1310 | bond->params.fail_over_mac = BOND_FOM_ACTIVE; |
1310 | pr_warn("%s: Setting fail_over_mac to active for active-backup mode\n", | 1311 | pr_warn("%s: Setting fail_over_mac to active for active-backup mode\n", |
1311 | bond_dev->name); | 1312 | bond_dev->name); |
1313 | } else { | ||
1314 | pr_err("%s: Error: The slave device specified does not support setting the MAC address, but fail_over_mac is not set to active\n", | ||
1315 | bond_dev->name); | ||
1316 | res = -EOPNOTSUPP; | ||
1317 | goto err_undo_flags; | ||
1312 | } | 1318 | } |
1313 | } else if (bond->params.fail_over_mac != BOND_FOM_ACTIVE) { | ||
1314 | pr_err("%s: Error: The slave device specified does not support setting the MAC address, but fail_over_mac is not set to active\n", | ||
1315 | bond_dev->name); | ||
1316 | res = -EOPNOTSUPP; | ||
1317 | goto err_undo_flags; | ||
1318 | } | 1319 | } |
1319 | } | 1320 | } |
1320 | 1321 | ||