Skip to content

Commit

Permalink
[BRIDGE]: fix race on bridge del if
Browse files Browse the repository at this point in the history
This fixes the RCU race on bridge delete interface.  Basically,
the network device has to be detached from the bridge in the first
step (pre-RCU), rather than later. At that point, no more bridge traffic
will come in, and the other code will not think that network device
is part of a bridge.

This should also fix the XEN test problems.

Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Stephen Hemminger authored and David S. Miller committed Oct 12, 2005
1 parent eeb2b85 commit ab4060e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/bridge/br_if.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ static void destroy_nbp(struct net_bridge_port *p)
{
struct net_device *dev = p->dev;

dev->br_port = NULL;
p->br = NULL;
p->dev = NULL;
dev_put(dev);
Expand All @@ -100,6 +99,7 @@ static void del_nbp(struct net_bridge_port *p)
struct net_bridge *br = p->br;
struct net_device *dev = p->dev;

dev->br_port = NULL;
dev_set_promiscuity(dev, -1);

spin_lock_bh(&br->lock);
Expand Down

0 comments on commit ab4060e

Please sign in to comment.