Hello David,
here are two fixes (the last set) we would to propose for net/linux-3.6.
The one from Def fixes a wrong behaviour of batman-adv in case of virtual interface mac address change, while the other from Linüs fixes a problem in the route selection which can lead to a continuous route flapping under certain conditions.
We would also like to enqueue both patches for sending to stable-3.5.
During merge with net/master you will hit a conflict. I'm going to send some instructions on how to solve it.
Thank you very much, Antonio
The following changes since commit 2b018d57ff18e5405823e5cb59651a5b4d946d7b:
pppoe: drop PPPOX_ZOMBIEs in pppoe_release (2012-09-22 15:49:31 -0400)
are available in the git repository at:
git://git.open-mesh.org/linux-merge.git tags/batman-adv-fix-for-davem
for you to fetch changes up to 7caf69fb9c5017df01945a1861c042f6aa08edeb:
batman-adv: Fix symmetry check / route flapping in multi interface setups (2012-09-23 23:12:49 +0200)
---------------------------------------------------------------- Included fixes: - fix the behaviour of batman-adv in case of virtual interface MAC change event - fix symmetric link check in neighbour selection
---------------------------------------------------------------- Def (1): batman-adv: Fix change mac address of soft iface.
Linus Lüssing (1): batman-adv: Fix symmetry check / route flapping in multi interface setups
net/batman-adv/bat_iv_ogm.c | 13 +++++++------ net/batman-adv/soft-interface.c | 7 +++++-- 2 files changed, 12 insertions(+), 8 deletions(-)
From: Def def@laposte.net
Into function interface_set_mac_addr, the function tt_local_add was invoked before updating dev->dev_addr. The new MAC address was not tagged as NoPurge.
Signed-off-by: Def def@laposte.net Signed-off-by: Antonio Quartulli ordex@autistici.org --- net/batman-adv/soft-interface.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/net/batman-adv/soft-interface.c b/net/batman-adv/soft-interface.c index 109ea2a..21c5357 100644 --- a/net/batman-adv/soft-interface.c +++ b/net/batman-adv/soft-interface.c @@ -100,18 +100,21 @@ static int batadv_interface_set_mac_addr(struct net_device *dev, void *p) { struct batadv_priv *bat_priv = netdev_priv(dev); struct sockaddr *addr = p; + uint8_t old_addr[ETH_ALEN];
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); + /* 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, dev->dev_addr, + batadv_tt_local_remove(bat_priv, old_addr, "mac address changed", false); batadv_tt_local_add(dev, addr->sa_data, BATADV_NULL_IFINDEX); }
- memcpy(dev->dev_addr, addr->sa_data, ETH_ALEN); dev->addr_assign_type &= ~NET_ADDR_RANDOM; return 0; }
From: Linus Lüssing linus.luessing@web.de
If receiving an OGM from a neighbor other than the currently selected and if it has the same TQ then we are supposed to switch if this neighbor provides a more symmetric link than the currently selected one.
However this symmetry check currently is broken if the interface of the neighbor we received the OGM from and the one of the currently selected neighbor differ: We are currently trying to determine the symmetry of the link towards the selected router via the link we received the OGM from instead of just checking via the link towards the currently selected router.
This leads to way more route switches than necessary and can lead to permanent route flapping in many common multi interface setups.
This patch fixes this issue by using the right interface for this symmetry check.
Signed-off-by: Linus Lüssing linus.luessing@web.de Signed-off-by: Antonio Quartulli ordex@autistici.org --- net/batman-adv/bat_iv_ogm.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/net/batman-adv/bat_iv_ogm.c b/net/batman-adv/bat_iv_ogm.c index e877af8..469daab 100644 --- a/net/batman-adv/bat_iv_ogm.c +++ b/net/batman-adv/bat_iv_ogm.c @@ -642,7 +642,8 @@ batadv_iv_ogm_orig_update(struct batadv_priv *bat_priv, struct batadv_neigh_node *router = NULL; struct batadv_orig_node *orig_node_tmp; struct hlist_node *node; - uint8_t bcast_own_sum_orig, bcast_own_sum_neigh; + int if_num; + uint8_t sum_orig, sum_neigh; uint8_t *neigh_addr;
batadv_dbg(BATADV_DBG_BATMAN, bat_priv, @@ -727,17 +728,17 @@ batadv_iv_ogm_orig_update(struct batadv_priv *bat_priv, if (router && (neigh_node->tq_avg == router->tq_avg)) { orig_node_tmp = router->orig_node; spin_lock_bh(&orig_node_tmp->ogm_cnt_lock); - bcast_own_sum_orig = - orig_node_tmp->bcast_own_sum[if_incoming->if_num]; + if_num = router->if_incoming->if_num; + sum_orig = orig_node_tmp->bcast_own_sum[if_num]; spin_unlock_bh(&orig_node_tmp->ogm_cnt_lock);
orig_node_tmp = neigh_node->orig_node; spin_lock_bh(&orig_node_tmp->ogm_cnt_lock); - bcast_own_sum_neigh = - orig_node_tmp->bcast_own_sum[if_incoming->if_num]; + if_num = neigh_node->if_incoming->if_num; + sum_neigh = orig_node_tmp->bcast_own_sum[if_num]; spin_unlock_bh(&orig_node_tmp->ogm_cnt_lock);
- if (bcast_own_sum_orig >= bcast_own_sum_neigh) + if (sum_orig >= sum_neigh) goto update_tt; }
Hello David,
here are some instructions to solve the conflict you will hit while merging net with net-next.
Thank you, Antonio
++<<<<<<< HEAD ++======= + int if_num; ++>>>>>>> 7caf69f... batman-adv: Fix symmetry check / route flapping in multi interface setups
resolves to: ======== int if_num;
>>
++<<<<<<< HEAD + sum_orig = orig_node_tmp->bcast_own_sum[if_incoming->if_num]; ++======= + if_num = router->if_incoming->if_num; + sum_orig = orig_node_tmp->bcast_own_sum[if_num]; ++>>>>>>> 7caf69f... batman-adv: Fix symmetry check / route flapping in multi interface setups
resolves to: ======= if_num = router->if_incoming->if_num; sum_orig = orig_node_tmp->bcast_own_sum[if_num];
>
++<<<<<<< HEAD + sum_neigh = orig_node_tmp->bcast_own_sum[if_incoming->if_num]; ++======= + if_num = neigh_node->if_incoming->if_num; + sum_neigh = orig_node_tmp->bcast_own_sum[if_num]; ++>>>>>>> 7caf69f... batman-adv: Fix symmetry check / route flapping in multi interface setups
resolves to: ======= if_num = neigh_node->if_incoming->if_num; sum_neigh = orig_node_tmp->bcast_own_sum[if_num];
From: Antonio Quartulli ordex@autistici.org Date: Tue, 25 Sep 2012 18:01:19 +0200
here are some instructions to solve the conflict you will hit while merging net with net-next.
Thanks a lot.
From: Antonio Quartulli ordex@autistici.org Date: Tue, 25 Sep 2012 17:57:15 +0200
here are two fixes (the last set) we would to propose for net/linux-3.6.
The one from Def fixes a wrong behaviour of batman-adv in case of virtual interface mac address change, while the other from Linüs fixes a problem in the route selection which can lead to a continuous route flapping under certain conditions.
We would also like to enqueue both patches for sending to stable-3.5.
During merge with net/master you will hit a conflict. I'm going to send some instructions on how to solve it.
...
git://git.open-mesh.org/linux-merge.git tags/batman-adv-fix-for-davem
Pulled, thanks.
b.a.t.m.a.n@lists.open-mesh.org