The following commit has been merged in the merge/master branch:
commit f6ffcca6c7faf21969a29d3ef7f05166340736fa
Merge: e1b9cf4b021b60f664ece222c47b1c7b3c38d7d2 a918eb9fac6431901fe8ec8a2cb31dfe6fdd1af7
Author: Antonio Quartulli <antonio(a)meshcoding.com>
Date: Tue Jan 6 09:12:52 2015 +0100
Merge remote-tracking branch 'net-next/master' into merge/master
Signed-off-by: Antonio Quartulli <antonio(a)meshcoding.com>
Conflicts:
net/batman-adv/main.h
net/batman-adv/multicast.c
net/batman-adv/send.c
net/batman-adv/soft-interface.c
diff --combined net/batman-adv/soft-interface.c
index e783afb,5467955..cfc2cd2
--- a/net/batman-adv/soft-interface.c
+++ b/net/batman-adv/soft-interface.c
@@@ -106,7 -106,6 +106,7 @@@ static struct net_device_stats *batadv_
static int batadv_interface_set_mac_addr(struct net_device *dev, void *p)
{
struct batadv_priv *bat_priv = netdev_priv(dev);
+ struct batadv_softif_vlan *vlan;
struct sockaddr *addr = p;
uint8_t old_addr[ETH_ALEN];
@@@ -117,17 -116,12 +117,17 @@@
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;
}
@@@ -454,14 -448,14 +454,14 @@@ out
* possibly free it
* @softif_vlan: the vlan object to release
*/
-void batadv_softif_vlan_free_ref(struct batadv_softif_vlan *vlan)
+void batadv_softif_vlan_free_ref(struct batadv_softif_vlan *softif_vlan)
{
- if (atomic_dec_and_test(&vlan->refcount)) {
- spin_lock_bh(&vlan->bat_priv->softif_vlan_list_lock);
- hlist_del_rcu(&vlan->list);
- spin_unlock_bh(&vlan->bat_priv->softif_vlan_list_lock);
+ if (atomic_dec_and_test(&softif_vlan->refcount)) {
+ spin_lock_bh(&softif_vlan->bat_priv->softif_vlan_list_lock);
+ hlist_del_rcu(&softif_vlan->list);
+ spin_unlock_bh(&softif_vlan->bat_priv->softif_vlan_list_lock);
- kfree_rcu(vlan, rcu);
+ kfree_rcu(softif_vlan, rcu);
}
}
@@@ -757,7 -751,7 +757,7 @@@ static int batadv_softif_init_late(stru
atomic_set(&bat_priv->gw.bandwidth_down, 100);
atomic_set(&bat_priv->gw.bandwidth_up, 20);
atomic_set(&bat_priv->orig_interval, 1000);
- atomic_set(&bat_priv->hop_penalty, 15);
+ atomic_set(&bat_priv->hop_penalty, 30);
#ifdef CONFIG_BATMAN_ADV_DEBUG
atomic_set(&bat_priv->log_level, 0);
#endif
@@@ -933,7 -927,7 +933,7 @@@ struct net_device *batadv_softif_create
int ret;
soft_iface = alloc_netdev(sizeof(struct batadv_priv), name,
- batadv_softif_init_early);
+ NET_NAME_UNKNOWN, batadv_softif_init_early);
if (!soft_iface)
return NULL;
--
linux integration