Repository : ssh://git@open-mesh.org/batman-adv
On branch : next
commit 0563fda54396e95a23af4e845df298b642715a2b Merge: b08dc3d 2ac2c94 Author: Marek Lindner mareklindner@neomailbox.ch Date: Fri May 2 13:06:52 2014 +0800
Merge branch 'maint' into next
0563fda54396e95a23af4e845df298b642715a2b bat_iv_ogm.c | 2 ++ distributed-arp-table.c | 3 +-- originator.c | 62 +++++++++++++++++++++++++++++++++++++++++++---- soft-interface.c | 12 ++++++--- 4 files changed, 69 insertions(+), 10 deletions(-)
diff --cc soft-interface.c index 744a59b,d962363..9f070de --- a/soft-interface.c +++ b/soft-interface.c @@@ -112,16 -112,21 +113,21 @@@ static int batadv_interface_set_mac_add if (!is_valid_ether_addr(addr->sa_data)) return -EADDRNOTAVAIL;
- memcpy(old_addr, dev->dev_addr, ETH_ALEN); - memcpy(dev->dev_addr, addr->sa_data, ETH_ALEN); + ether_addr_copy(old_addr, dev->dev_addr); + ether_addr_copy(dev->dev_addr, addr->sa_data);
/* only modify transtable if it has been initialized before */ - if (atomic_read(&bat_priv->mesh_state) == BATADV_MESH_ACTIVE) { - batadv_tt_local_remove(bat_priv, old_addr, BATADV_NO_FLAGS, + if (atomic_read(&bat_priv->mesh_state) != BATADV_MESH_ACTIVE) + return 0; + + rcu_read_lock(); + hlist_for_each_entry_rcu(vlan, &bat_priv->softif_vlan_list, list) { + batadv_tt_local_remove(bat_priv, old_addr, vlan->vid, "mac address changed", false); - batadv_tt_local_add(dev, addr->sa_data, BATADV_NO_FLAGS, + batadv_tt_local_add(dev, addr->sa_data, vlan->vid, BATADV_NULL_IFINDEX, BATADV_NO_MARK); } + rcu_read_unlock();
return 0; }