batman-adv: make is_my_mac() check for the current mesh only
On a multi-mesh node (a node running more than one batman-adv virtual interface) batadv_is_my_mac() has to check MAC addresses of hard interfaces belonging to the current mesh only. Signed-off-by: Antonio Quartulli <ordex@autistici.org> Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
This commit is contained in:
@@ -169,7 +169,7 @@ void batadv_mesh_free(struct net_device *soft_iface)
|
||||
atomic_set(&bat_priv->mesh_state, BATADV_MESH_INACTIVE);
|
||||
}
|
||||
|
||||
int batadv_is_my_mac(const uint8_t *addr)
|
||||
int batadv_is_my_mac(struct batadv_priv *bat_priv, const uint8_t *addr)
|
||||
{
|
||||
const struct batadv_hard_iface *hard_iface;
|
||||
|
||||
@@ -178,6 +178,9 @@ int batadv_is_my_mac(const uint8_t *addr)
|
||||
if (hard_iface->if_status != BATADV_IF_ACTIVE)
|
||||
continue;
|
||||
|
||||
if (hard_iface->soft_iface != bat_priv->soft_iface)
|
||||
continue;
|
||||
|
||||
if (batadv_compare_eth(hard_iface->net_dev->dev_addr, addr)) {
|
||||
rcu_read_unlock();
|
||||
return 1;
|
||||
|
Reference in New Issue
Block a user