bridge: fdb: add proper lock checks in searching functions
In order to avoid new errors add checks to br_fdb_find and fdb_find_rcu functions. The first requires hash_lock, the second obviously RCU. Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
bfd0aeac52
commit
410b3d48f5
@@ -531,6 +531,15 @@ int br_fdb_external_learn_add(struct net_bridge *br, struct net_bridge_port *p,
|
||||
int br_fdb_external_learn_del(struct net_bridge *br, struct net_bridge_port *p,
|
||||
const unsigned char *addr, u16 vid);
|
||||
|
||||
static inline bool br_hash_lock_held(struct net_bridge *br)
|
||||
{
|
||||
#ifdef CONFIG_LOCKDEP
|
||||
return lockdep_is_held(&br->hash_lock);
|
||||
#else
|
||||
return true;
|
||||
#endif
|
||||
}
|
||||
|
||||
/* br_forward.c */
|
||||
enum br_pkt_type {
|
||||
BR_PKT_UNICAST,
|
||||
|
Reference in New Issue
Block a user