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>
This commit is contained in:
parent
2925f6c0c7
commit
2ce297fc24
3 changed files with 5 additions and 4 deletions
|
@ -37,6 +37,7 @@
|
|||
rcu_dereference_protected(X, lockdep_is_held(&br->multicast_lock))
|
||||
|
||||
static void br_multicast_start_querier(struct net_bridge *br);
|
||||
unsigned int br_mdb_rehash_seq;
|
||||
|
||||
#if IS_ENABLED(CONFIG_IPV6)
|
||||
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,
|
|||
return err;
|
||||
}
|
||||
|
||||
br_mdb_rehash_seq++;
|
||||
call_rcu_bh(&mdb->rcu, br_mdb_free);
|
||||
|
||||
out:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue