diff options
author | Jiri Pirko <jpirko@redhat.com> | 2010-03-10 10:29:35 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-03-18 20:00:02 -0700 |
commit | 3ca5b4042ecae5e73c59de62e4ac0db31c10e0f8 (patch) | |
tree | a285e4281bd9ee6a248d905cd4707c15a66bac96 /drivers/net/bonding | |
parent | 93d9b7d7a85cfb4e1711d5226eba73586dd4919f (diff) | |
download | blackbird-obmc-linux-3ca5b4042ecae5e73c59de62e4ac0db31c10e0f8.tar.gz blackbird-obmc-linux-3ca5b4042ecae5e73c59de62e4ac0db31c10e0f8.zip |
bonding: check return value of nofitier when changing type
This patch adds the possibility to refuse the bonding type change for
other subsystems (such as for example bridge, vlan, etc.)
Signed-off-by: Jiri Pirko <jpirko@redhat.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 | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index 7eeb18751d67..cbe9e353d46a 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c @@ -1480,8 +1480,15 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev) bond_dev->name, bond_dev->type, slave_dev->type); - netdev_bonding_change(bond_dev, - NETDEV_PRE_TYPE_CHANGE); + res = netdev_bonding_change(bond_dev, + NETDEV_PRE_TYPE_CHANGE); + res = notifier_to_errno(res); + if (res) { + pr_err("%s: refused to change device type\n", + bond_dev->name); + res = -EBUSY; + goto err_undo_flags; + } if (slave_dev->type != ARPHRD_ETHER) bond_setup_by_slave(bond_dev, slave_dev); |