diff options
-rw-r--r-- | drivers/net/bonding/bond_main.c | 11 | ||||
-rw-r--r-- | include/linux/netdevice.h | 2 | ||||
-rw-r--r-- | net/core/dev.c | 4 |
3 files changed, 12 insertions, 5 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) | |||
1480 | bond_dev->name, | 1480 | bond_dev->name, |
1481 | bond_dev->type, slave_dev->type); | 1481 | bond_dev->type, slave_dev->type); |
1482 | 1482 | ||
1483 | netdev_bonding_change(bond_dev, | 1483 | res = netdev_bonding_change(bond_dev, |
1484 | NETDEV_PRE_TYPE_CHANGE); | 1484 | NETDEV_PRE_TYPE_CHANGE); |
1485 | res = notifier_to_errno(res); | ||
1486 | if (res) { | ||
1487 | pr_err("%s: refused to change device type\n", | ||
1488 | bond_dev->name); | ||
1489 | res = -EBUSY; | ||
1490 | goto err_undo_flags; | ||
1491 | } | ||
1485 | 1492 | ||
1486 | if (slave_dev->type != ARPHRD_ETHER) | 1493 | if (slave_dev->type != ARPHRD_ETHER) |
1487 | bond_setup_by_slave(bond_dev, slave_dev); | 1494 | bond_setup_by_slave(bond_dev, slave_dev); |
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 726ecd1af535..813bed723f58 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
@@ -2005,7 +2005,7 @@ extern void __dev_addr_unsync(struct dev_addr_list **to, int *to_count, struct | |||
2005 | extern int dev_set_promiscuity(struct net_device *dev, int inc); | 2005 | extern int dev_set_promiscuity(struct net_device *dev, int inc); |
2006 | extern int dev_set_allmulti(struct net_device *dev, int inc); | 2006 | extern int dev_set_allmulti(struct net_device *dev, int inc); |
2007 | extern void netdev_state_change(struct net_device *dev); | 2007 | extern void netdev_state_change(struct net_device *dev); |
2008 | extern void netdev_bonding_change(struct net_device *dev, | 2008 | extern int netdev_bonding_change(struct net_device *dev, |
2009 | unsigned long event); | 2009 | unsigned long event); |
2010 | extern void netdev_features_change(struct net_device *dev); | 2010 | extern void netdev_features_change(struct net_device *dev); |
2011 | /* Load a device via the kmod */ | 2011 | /* Load a device via the kmod */ |
diff --git a/net/core/dev.c b/net/core/dev.c index 1a7e1d1d5ad9..d1f027c41e73 100644 --- a/net/core/dev.c +++ b/net/core/dev.c | |||
@@ -1084,9 +1084,9 @@ void netdev_state_change(struct net_device *dev) | |||
1084 | } | 1084 | } |
1085 | EXPORT_SYMBOL(netdev_state_change); | 1085 | EXPORT_SYMBOL(netdev_state_change); |
1086 | 1086 | ||
1087 | void netdev_bonding_change(struct net_device *dev, unsigned long event) | 1087 | int netdev_bonding_change(struct net_device *dev, unsigned long event) |
1088 | { | 1088 | { |
1089 | call_netdevice_notifiers(event, dev); | 1089 | return call_netdevice_notifiers(event, dev); |
1090 | } | 1090 | } |
1091 | EXPORT_SYMBOL(netdev_bonding_change); | 1091 | EXPORT_SYMBOL(netdev_bonding_change); |
1092 | 1092 | ||