]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/6.6.26/net-hsr-hsr_slave-fix-the-promiscuous-mode-in-offloa.patch
Linux 6.1.85
[thirdparty/kernel/stable-queue.git] / releases / 6.6.26 / net-hsr-hsr_slave-fix-the-promiscuous-mode-in-offloa.patch
1 From a4988dd667392c8213f1aacce9f95e68a1cdbef0 Mon Sep 17 00:00:00 2001
2 From: Sasha Levin <sashal@kernel.org>
3 Date: Fri, 22 Mar 2024 15:34:47 +0530
4 Subject: net: hsr: hsr_slave: Fix the promiscuous mode in offload mode
5
6 From: Ravi Gunasekaran <r-gunasekaran@ti.com>
7
8 [ Upstream commit b11c81731c810efe592e510bb0110e0db6877419 ]
9
10 commit e748d0fd66ab ("net: hsr: Disable promiscuous mode in
11 offload mode") disables promiscuous mode of slave devices
12 while creating an HSR interface. But while deleting the
13 HSR interface, it does not take care of it. It decreases the
14 promiscuous mode count, which eventually enables promiscuous
15 mode on the slave devices when creating HSR interface again.
16
17 Fix this by not decrementing the promiscuous mode count while
18 deleting the HSR interface when offload is enabled.
19
20 Fixes: e748d0fd66ab ("net: hsr: Disable promiscuous mode in offload mode")
21 Signed-off-by: Ravi Gunasekaran <r-gunasekaran@ti.com>
22 Reviewed-by: Jiri Pirko <jiri@nvidia.com>
23 Link: https://lore.kernel.org/r/20240322100447.27615-1-r-gunasekaran@ti.com
24 Signed-off-by: Jakub Kicinski <kuba@kernel.org>
25 Signed-off-by: Sasha Levin <sashal@kernel.org>
26 ---
27 net/hsr/hsr_slave.c | 3 ++-
28 1 file changed, 2 insertions(+), 1 deletion(-)
29
30 diff --git a/net/hsr/hsr_slave.c b/net/hsr/hsr_slave.c
31 index e5742f2a2d522..1b6457f357bdb 100644
32 --- a/net/hsr/hsr_slave.c
33 +++ b/net/hsr/hsr_slave.c
34 @@ -220,7 +220,8 @@ void hsr_del_port(struct hsr_port *port)
35 netdev_update_features(master->dev);
36 dev_set_mtu(master->dev, hsr_get_max_mtu(hsr));
37 netdev_rx_handler_unregister(port->dev);
38 - dev_set_promiscuity(port->dev, -1);
39 + if (!port->hsr->fwd_offloaded)
40 + dev_set_promiscuity(port->dev, -1);
41 netdev_upper_dev_unlink(port->dev, master->dev);
42 }
43
44 --
45 2.43.0
46