summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRavi Gunasekaran <r-gunasekaran@ti.com>2024-03-22 15:34:47 +0530
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-04-10 16:35:42 +0200
commit984c3d962c9ef711016e46dc8986cbd9241fdd85 (patch)
tree0e0232919f0eef596142f051da7ddf9dd2190d6b
parent21dea1475fd453ac4feaa3c395f51c61b5779260 (diff)
downloadlinux-stable-984c3d962c9ef711016e46dc8986cbd9241fdd85.tar.gz
linux-stable-984c3d962c9ef711016e46dc8986cbd9241fdd85.tar.bz2
linux-stable-984c3d962c9ef711016e46dc8986cbd9241fdd85.zip
net: hsr: hsr_slave: Fix the promiscuous mode in offload mode
[ Upstream commit b11c81731c810efe592e510bb0110e0db6877419 ] commit e748d0fd66ab ("net: hsr: Disable promiscuous mode in offload mode") disables promiscuous mode of slave devices while creating an HSR interface. But while deleting the HSR interface, it does not take care of it. It decreases the promiscuous mode count, which eventually enables promiscuous mode on the slave devices when creating HSR interface again. Fix this by not decrementing the promiscuous mode count while deleting the HSR interface when offload is enabled. Fixes: e748d0fd66ab ("net: hsr: Disable promiscuous mode in offload mode") Signed-off-by: Ravi Gunasekaran <r-gunasekaran@ti.com> Reviewed-by: Jiri Pirko <jiri@nvidia.com> Link: https://lore.kernel.org/r/20240322100447.27615-1-r-gunasekaran@ti.com Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r--net/hsr/hsr_slave.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/net/hsr/hsr_slave.c b/net/hsr/hsr_slave.c
index e5742f2a2d52..1b6457f357bd 100644
--- a/net/hsr/hsr_slave.c
+++ b/net/hsr/hsr_slave.c
@@ -220,7 +220,8 @@ void hsr_del_port(struct hsr_port *port)
netdev_update_features(master->dev);
dev_set_mtu(master->dev, hsr_get_max_mtu(hsr));
netdev_rx_handler_unregister(port->dev);
- dev_set_promiscuity(port->dev, -1);
+ if (!port->hsr->fwd_offloaded)
+ dev_set_promiscuity(port->dev, -1);
netdev_upper_dev_unlink(port->dev, master->dev);
}