Skip to content

Commit 2eaf0c0

Browse files
Ravi Gunasekarangregkh
authored andcommitted
net: hsr: hsr_slave: Fix the promiscuous mode in offload mode
commit b11c817 upstream. commit e748d0f ("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: e748d0f ("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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent fa725a4 commit 2eaf0c0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

net/hsr/hsr_slave.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,8 @@ void hsr_del_port(struct hsr_port *port)
226226
netdev_update_features(master->dev);
227227
dev_set_mtu(master->dev, hsr_get_max_mtu(hsr));
228228
netdev_rx_handler_unregister(port->dev);
229-
dev_set_promiscuity(port->dev, -1);
229+
if (!port->hsr->fwd_offloaded)
230+
dev_set_promiscuity(port->dev, -1);
230231
netdev_upper_dev_unlink(port->dev, master->dev);
231232
}
232233

0 commit comments

Comments
 (0)