bridge: multicast flood
authorstephen hemminger <shemminger@vyatta.com>
Tue, 27 Apr 2010 15:01:05 +0000 (15:01 +0000)
committerDavid S. Miller <davem@davemloft.net>
Wed, 28 Apr 2010 01:13:54 +0000 (18:13 -0700)
Fix unsafe usage of RCU. Would never work on Alpha SMP because
of lack of rcu_dereference()

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/bridge/br_forward.c

index 7a241c396981eebb9ee1357daf88e7d18f3f8db8..5b70fc012e40059a8760bb892e62fdeeacdf62c8 100644 (file)
@@ -216,7 +216,7 @@ static void br_multicast_flood(struct net_bridge_mdb_entry *mdst,
 
        prev = NULL;
 
-       rp = br->router_list.first;
+       rp = rcu_dereference(br->router_list.first);
        p = mdst ? mdst->ports : NULL;
        while (p || rp) {
                lport = p ? p->port : NULL;
@@ -233,7 +233,7 @@ static void br_multicast_flood(struct net_bridge_mdb_entry *mdst,
                if ((unsigned long)lport >= (unsigned long)port)
                        p = p->next;
                if ((unsigned long)rport >= (unsigned long)port)
-                       rp = rp->next;
+                       rp = rcu_dereference(rp->next);
        }
 
        if (!prev)