]> git.baikalelectronics.ru Git - kernel.git/commit
net: team: Unsync device addresses on ndo_stop
authorBenjamin Poirier <bpoirier@nvidia.com>
Wed, 7 Sep 2022 07:56:41 +0000 (16:56 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 28 Sep 2022 09:04:05 +0000 (11:04 +0200)
commit5a3e1c9523ab2f3625775cbe0d468c1aa8e217e8
treee996a1ea6472ecb9b80a09c50b3ff41b5db52076
parentbd07583de15cbd37a1777119865304304eaf673a
net: team: Unsync device addresses on ndo_stop

[ Upstream commit 5217c971831f4359356d6f61a096b83056f129e7 ]

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 team 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 team
ports after a team device has been deleted; see test_LAG_cleanup() in the
last patch in this series.

Add unsync calls at their expected location, team_close().

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

Fixes: c4c5d58badd6 ("net: introduce ethernet teaming device")
Signed-off-by: Benjamin Poirier <bpoirier@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/team/team.c