aboutsummaryrefslogtreecommitdiffstats
path: root/net/bridge/br_if.c
diff options
context:
space:
mode:
authorStephen Hemminger <shemminger@osdl.org>2005-10-12 18:10:01 -0400
committerDavid S. Miller <davem@davemloft.net>2005-10-12 18:10:01 -0400
commitab4060e858e36129f9319ef0fa055347ad60e1d5 (patch)
treec3d28036801fcab8529bd8ee977fafd755fb3da4 /net/bridge/br_if.c
parenteeb2b8560676e454ad37ee30b49bc7d897edc9be (diff)
[BRIDGE]: fix race on bridge del if
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>
Diffstat (limited to 'net/bridge/br_if.c')
-rw-r--r--net/bridge/br_if.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/bridge/br_if.c b/net/bridge/br_if.c
index 91bb895375f..defcf6a8607 100644
--- a/net/bridge/br_if.c
+++ b/net/bridge/br_if.c
@@ -79,7 +79,6 @@ static void destroy_nbp(struct net_bridge_port *p)
79{ 79{
80 struct net_device *dev = p->dev; 80 struct net_device *dev = p->dev;
81 81
82 dev->br_port = NULL;
83 p->br = NULL; 82 p->br = NULL;
84 p->dev = NULL; 83 p->dev = NULL;
85 dev_put(dev); 84 dev_put(dev);
@@ -100,6 +99,7 @@ static void del_nbp(struct net_bridge_port *p)
100 struct net_bridge *br = p->br; 99 struct net_bridge *br = p->br;
101 struct net_device *dev = p->dev; 100 struct net_device *dev = p->dev;
102 101
102 dev->br_port = NULL;
103 dev_set_promiscuity(dev, -1); 103 dev_set_promiscuity(dev, -1);
104 104
105 spin_lock_bh(&br->lock); 105 spin_lock_bh(&br->lock);