diff options
author | Cong Wang <amwang@redhat.com> | 2012-12-09 21:15:35 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-12-11 13:44:09 -0500 |
commit | 2ce297fc24d1f0b70c756d1f593e7a089a2d888d (patch) | |
tree | c29d8d8f76ff8c8d574e70a9c28aa06a0a4b4211 /net/bridge/br_multicast.c | |
parent | 2925f6c0c7af32720dcbadc586463aeceb6baa22 (diff) |
bridge: fix seq check in br_mdb_dump()
In case of rehashing, introduce a global variable 'br_mdb_rehash_seq'
which gets increased every time when rehashing, and assign
net->dev_base_seq + br_mdb_rehash_seq to cb->seq.
In theory cb->seq could be wrapped to zero, but this is not
easy to fix, as net->dev_base_seq is not visible inside
br_mdb_rehash(). In practice, this is rare.
Cc: Herbert Xu <herbert@gondor.apana.org.au>
Cc: Stephen Hemminger <shemminger@vyatta.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Thomas Graf <tgraf@suug.ch>
Cc: Jesper Dangaard Brouer <brouer@redhat.com>
Signed-off-by: Cong Wang <amwang@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/bridge/br_multicast.c')
-rw-r--r-- | net/bridge/br_multicast.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/net/bridge/br_multicast.c b/net/bridge/br_multicast.c index 68e375ac93bd..847b98a1d5e0 100644 --- a/net/bridge/br_multicast.c +++ b/net/bridge/br_multicast.c | |||
@@ -37,6 +37,7 @@ | |||
37 | rcu_dereference_protected(X, lockdep_is_held(&br->multicast_lock)) | 37 | rcu_dereference_protected(X, lockdep_is_held(&br->multicast_lock)) |
38 | 38 | ||
39 | static void br_multicast_start_querier(struct net_bridge *br); | 39 | static void br_multicast_start_querier(struct net_bridge *br); |
40 | unsigned int br_mdb_rehash_seq; | ||
40 | 41 | ||
41 | #if IS_ENABLED(CONFIG_IPV6) | 42 | #if IS_ENABLED(CONFIG_IPV6) |
42 | static inline int ipv6_is_transient_multicast(const struct in6_addr *addr) | 43 | static inline int ipv6_is_transient_multicast(const struct in6_addr *addr) |
@@ -338,6 +339,7 @@ static int br_mdb_rehash(struct net_bridge_mdb_htable __rcu **mdbp, int max, | |||
338 | return err; | 339 | return err; |
339 | } | 340 | } |
340 | 341 | ||
342 | br_mdb_rehash_seq++; | ||
341 | call_rcu_bh(&mdb->rcu, br_mdb_free); | 343 | call_rcu_bh(&mdb->rcu, br_mdb_free); |
342 | 344 | ||
343 | out: | 345 | out: |