Skip to content

Commit

Permalink
net: hsr: hsr_slave: Fix the promiscuous mode in offload mode
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-by: Jiri Pirko <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Jakub Kicinski <[email protected]>
  • Loading branch information
Ravi Gunasekaran authored and kuba-moo committed Mar 26, 2024
1 parent 3a38a82 commit b11c817
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion net/hsr/hsr_slave.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit b11c817

Please sign in to comment.