diff options
author | stephen hemminger <shemminger@vyatta.com> | 2010-04-27 11:01:06 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-04-27 21:13:54 -0400 |
commit | 83f6a740b4e52f88e312223df2fc94016a208618 (patch) | |
tree | 7cb24cc5a3a5779fe3dd9fbba3351cac19062b1f | |
parent | 168d40ee3d147ae20860e7916bd79b636cbe8fd5 (diff) |
bridge: multicast port group RCU fix
The recently introduced bridge mulitcast port group list was only
partially using RCU correctly. It was missing rcu_dereference()
and missing the necessary barrier on deletion.
The code should have used one of the standard list methods (list or hlist)
instead of open coding a RCU based link list.
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | net/bridge/br_forward.c | 4 | ||||
-rw-r--r-- | net/bridge/br_multicast.c | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/net/bridge/br_forward.c b/net/bridge/br_forward.c index 5b70fc012e40..5f9988a3f06a 100644 --- a/net/bridge/br_forward.c +++ b/net/bridge/br_forward.c | |||
@@ -217,7 +217,7 @@ static void br_multicast_flood(struct net_bridge_mdb_entry *mdst, | |||
217 | prev = NULL; | 217 | prev = NULL; |
218 | 218 | ||
219 | rp = rcu_dereference(br->router_list.first); | 219 | rp = rcu_dereference(br->router_list.first); |
220 | p = mdst ? mdst->ports : NULL; | 220 | p = mdst ? rcu_dereference(mdst->ports) : NULL; |
221 | while (p || rp) { | 221 | while (p || rp) { |
222 | lport = p ? p->port : NULL; | 222 | lport = p ? p->port : NULL; |
223 | rport = rp ? hlist_entry(rp, struct net_bridge_port, rlist) : | 223 | rport = rp ? hlist_entry(rp, struct net_bridge_port, rlist) : |
@@ -231,7 +231,7 @@ static void br_multicast_flood(struct net_bridge_mdb_entry *mdst, | |||
231 | goto out; | 231 | goto out; |
232 | 232 | ||
233 | if ((unsigned long)lport >= (unsigned long)port) | 233 | if ((unsigned long)lport >= (unsigned long)port) |
234 | p = p->next; | 234 | p = rcu_dereference(p->next); |
235 | if ((unsigned long)rport >= (unsigned long)port) | 235 | if ((unsigned long)rport >= (unsigned long)port) |
236 | rp = rcu_dereference(rp->next); | 236 | rp = rcu_dereference(rp->next); |
237 | } | 237 | } |
diff --git a/net/bridge/br_multicast.c b/net/bridge/br_multicast.c index d63868c9b2c0..7128abdce45f 100644 --- a/net/bridge/br_multicast.c +++ b/net/bridge/br_multicast.c | |||
@@ -259,7 +259,7 @@ static void br_multicast_del_pg(struct net_bridge *br, | |||
259 | if (p != pg) | 259 | if (p != pg) |
260 | continue; | 260 | continue; |
261 | 261 | ||
262 | *pp = p->next; | 262 | rcu_assign_pointer(*pp, p->next); |
263 | hlist_del_init(&p->mglist); | 263 | hlist_del_init(&p->mglist); |
264 | del_timer(&p->timer); | 264 | del_timer(&p->timer); |
265 | del_timer(&p->query_timer); | 265 | del_timer(&p->query_timer); |