]> git.itanic.dy.fi Git - linux-stable/commit
net: bonding: Unsync device addresses on ndo_stop
authorBenjamin Poirier <bpoirier@nvidia.com>
Wed, 7 Sep 2022 07:56:40 +0000 (16:56 +0900)
committerDavid S. Miller <davem@davemloft.net>
Fri, 16 Sep 2022 13:34:01 +0000 (14:34 +0100)
commit86247aba599e5b07d7e828e6edaaebb0ef2b1158
treea6f1909fa739b20495fd1d74e29050217152544c
parent1d9a143ee3408349700f44a9197b7ae0e4faae5d
net: bonding: Unsync device addresses on ndo_stop

Netdev drivers are expected to call dev_{uc,mc}_sync() in their
ndo_set_rx_mode method and dev_{uc,mc}_unsync() in their ndo_stop method.
This is mentioned in the kerneldoc for those dev_* functions.

The bonding driver calls dev_{uc,mc}_unsync() during ndo_uninit instead of
ndo_stop. This is ineffective because address lists (dev->{uc,mc}) have
already been emptied in unregister_netdevice_many() before ndo_uninit is
called. This mistake can result in addresses being leftover on former bond
slaves after a bond has been deleted; see test_LAG_cleanup() in the last
patch in this series.

Add unsync calls, via bond_hw_addr_flush(), at their expected location,
bond_close().
Add dev_mc_add() call to bond_open() to match the above change.

v3:
* When adding or deleting a slave, only sync/unsync, add/del addresses if
  the bond is up. In other cases, it is taken care of at the right time by
  ndo_open/ndo_set_rx_mode/ndo_stop.

Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Signed-off-by: Benjamin Poirier <bpoirier@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/bonding/bond_main.c