summaryrefslogtreecommitdiffstats
path: root/drivers/net/bonding/bond_main.c
diff options
context:
space:
mode:
authorPetr Machata <petrm@mellanox.com>2018-12-13 12:54:46 +0100
committerDavid S. Miller <davem@davemloft.net>2018-12-14 03:41:39 +0100
commit1caf40dec1e2098d5f0bef3a627f0b08b2f65f9c (patch)
tree6f787339418fe9e11db4591ec985646a8f68eddd /drivers/net/bonding/bond_main.c
parentnet: bonding: Give bond_set_dev_addr() a return value (diff)
downloadlinux-1caf40dec1e2098d5f0bef3a627f0b08b2f65f9c.tar.xz
linux-1caf40dec1e2098d5f0bef3a627f0b08b2f65f9c.zip
net: bonding: Issue NETDEV_PRE_CHANGEADDR
Give interested parties an opportunity to veto an impending HW address change. Signed-off-by: Petr Machata <petrm@mellanox.com> Acked-by: Jiri Pirko <jiri@mellanox.com> Reviewed-by: Ido Schimmel <idosch@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/bonding/bond_main.c')
-rw-r--r--drivers/net/bonding/bond_main.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 66d9a6c7b9c5..a9d597f28023 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -612,8 +612,14 @@ static void bond_hw_addr_swap(struct bonding *bond, struct slave *new_active,
static int bond_set_dev_addr(struct net_device *bond_dev,
struct net_device *slave_dev)
{
+ int err;
+
netdev_dbg(bond_dev, "bond_dev=%p slave_dev=%p slave_dev->name=%s slave_dev->addr_len=%d\n",
bond_dev, slave_dev, slave_dev->name, slave_dev->addr_len);
+ err = dev_pre_changeaddr_notify(bond_dev, slave_dev->dev_addr, NULL);
+ if (err)
+ return err;
+
memcpy(bond_dev->dev_addr, slave_dev->dev_addr, slave_dev->addr_len);
bond_dev->addr_assign_type = NET_ADDR_STOLEN;
call_netdevice_notifiers(NETDEV_CHANGEADDR, bond_dev);