Skip to content

Commit

Permalink
[BRIDGE]: Fix locking of set path cost.
Browse files Browse the repository at this point in the history
This change goes with earlier change to get rid of
work queue for path cost. Now stp_set_path_cost does its own
locking. This is to allow it to call br_path_cost() which calls
ethtool interfaces (might sleep).

Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Stephen Hemminger authored and David S. Miller committed Feb 28, 2007
1 parent aa6e4a9 commit 6548cda
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions net/bridge/br_ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -291,12 +291,11 @@ static int old_dev_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
if (!capable(CAP_NET_ADMIN))
return -EPERM;

spin_lock_bh(&br->lock);
if ((p = br_get_port(br, args[1])) == NULL)
ret = -EINVAL;
else
br_stp_set_path_cost(p, args[2]);
spin_unlock_bh(&br->lock);

return ret;
}

Expand Down

0 comments on commit 6548cda

Please sign in to comment.