diff options
author | Petr Machata <petrm@mellanox.com> | 2018-12-13 11:54:35 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-12-13 18:41:38 -0800 |
commit | d59cdf9475ad84d1f57cab1d162cf289702cfb15 (patch) | |
tree | 192e3f68684228dda9a057f8ff49caf6974892f3 /net/core/dev_addr_lists.c | |
parent | 1570415f0810fce085066fb39827397452c3965a (diff) | |
download | linux-d59cdf9475ad84d1f57cab1d162cf289702cfb15.tar.gz linux-d59cdf9475ad84d1f57cab1d162cf289702cfb15.tar.bz2 linux-d59cdf9475ad84d1f57cab1d162cf289702cfb15.zip |
net: dev: Issue NETDEV_PRE_CHANGEADDR
When a device address is about to be changed, or an address added to the
list of device HW addresses, it is necessary to ensure that all
interested parties can support the address. Therefore, send the
NETDEV_PRE_CHANGEADDR notification, and if anyone bails on it, do not
change the address.
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 'net/core/dev_addr_lists.c')
-rw-r--r-- | net/core/dev_addr_lists.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/net/core/dev_addr_lists.c b/net/core/dev_addr_lists.c index 81a8cd4ea3bd..a6723b306717 100644 --- a/net/core/dev_addr_lists.c +++ b/net/core/dev_addr_lists.c @@ -498,6 +498,9 @@ int dev_addr_add(struct net_device *dev, const unsigned char *addr, ASSERT_RTNL(); + err = dev_pre_changeaddr_notify(dev, addr, NULL); + if (err) + return err; err = __hw_addr_add(&dev->dev_addrs, addr, dev->addr_len, addr_type); if (!err) call_netdevice_notifiers(NETDEV_CHANGEADDR, dev); |