* pull request: batman-adv 2012-09-25 @ 2012-09-25 15:57 Antonio Quartulli 2012-09-25 15:57 ` [PATCH net 2/2] batman-adv: Fix symmetry check / route flapping in multi interface setups Antonio Quartulli [not found] ` <1348588637-18441-1-git-send-email-ordex-GaUfNO9RBHfsrOwW+9ziJQ@public.gmane.org> 0 siblings, 2 replies; 6+ messages in thread From: Antonio Quartulli @ 2012-09-25 15:57 UTC (permalink / raw) To: davem; +Cc: netdev, b.a.t.m.a.n 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(-) ^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH net 2/2] batman-adv: Fix symmetry check / route flapping in multi interface setups 2012-09-25 15:57 pull request: batman-adv 2012-09-25 Antonio Quartulli @ 2012-09-25 15:57 ` Antonio Quartulli [not found] ` <1348588637-18441-1-git-send-email-ordex-GaUfNO9RBHfsrOwW+9ziJQ@public.gmane.org> 1 sibling, 0 replies; 6+ messages in thread From: Antonio Quartulli @ 2012-09-25 15:57 UTC (permalink / raw) To: davem; +Cc: netdev, b.a.t.m.a.n, Linus Lüssing, Antonio Quartulli 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; } -- 1.7.12 ^ permalink raw reply related [flat|nested] 6+ messages in thread
[parent not found: <1348588637-18441-1-git-send-email-ordex-GaUfNO9RBHfsrOwW+9ziJQ@public.gmane.org>]
* [PATCH net 1/2] batman-adv: Fix change mac address of soft iface. [not found] ` <1348588637-18441-1-git-send-email-ordex-GaUfNO9RBHfsrOwW+9ziJQ@public.gmane.org> @ 2012-09-25 15:57 ` Antonio Quartulli 2012-09-25 16:01 ` pull request: batman-adv 2012-09-25 Antonio Quartulli 2012-09-25 17:25 ` David Miller 2 siblings, 0 replies; 6+ messages in thread From: Antonio Quartulli @ 2012-09-25 15:57 UTC (permalink / raw) To: davem-fT/PcQaiUtIeIZ0/mPfg9Q Cc: netdev-u79uwXL29TY76Z2rM5mHXA, b.a.t.m.a.n-ZwoEplunGu2X36UT3dwllkB+6BGkLq7r From: Def <def-QFKgK+z4sOrR7s880joybQ@public.gmane.org> 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-QFKgK+z4sOrR7s880joybQ@public.gmane.org> Signed-off-by: Antonio Quartulli <ordex-GaUfNO9RBHfsrOwW+9ziJQ@public.gmane.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; } -- 1.7.12 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: pull request: batman-adv 2012-09-25 [not found] ` <1348588637-18441-1-git-send-email-ordex-GaUfNO9RBHfsrOwW+9ziJQ@public.gmane.org> 2012-09-25 15:57 ` [PATCH net 1/2] batman-adv: Fix change mac address of soft iface Antonio Quartulli @ 2012-09-25 16:01 ` Antonio Quartulli [not found] ` <20120925160119.GA31069-E/2OGukznS5g9hUCZPvPmw@public.gmane.org> 2012-09-25 17:25 ` David Miller 2 siblings, 1 reply; 6+ messages in thread From: Antonio Quartulli @ 2012-09-25 16:01 UTC (permalink / raw) To: davem-fT/PcQaiUtIeIZ0/mPfg9Q Cc: netdev-u79uwXL29TY76Z2rM5mHXA, b.a.t.m.a.n-ZwoEplunGu2X36UT3dwllkB+6BGkLq7r 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]; >>>>>> ^ permalink raw reply [flat|nested] 6+ messages in thread
[parent not found: <20120925160119.GA31069-E/2OGukznS5g9hUCZPvPmw@public.gmane.org>]
* Re: pull request: batman-adv 2012-09-25 [not found] ` <20120925160119.GA31069-E/2OGukznS5g9hUCZPvPmw@public.gmane.org> @ 2012-09-28 18:42 ` David Miller 0 siblings, 0 replies; 6+ messages in thread From: David Miller @ 2012-09-28 18:42 UTC (permalink / raw) To: ordex-GaUfNO9RBHfsrOwW+9ziJQ Cc: netdev-u79uwXL29TY76Z2rM5mHXA, b.a.t.m.a.n-ZwoEplunGu2X36UT3dwllkB+6BGkLq7r From: Antonio Quartulli <ordex-GaUfNO9RBHfsrOwW+9ziJQ@public.gmane.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. ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: pull request: batman-adv 2012-09-25 [not found] ` <1348588637-18441-1-git-send-email-ordex-GaUfNO9RBHfsrOwW+9ziJQ@public.gmane.org> 2012-09-25 15:57 ` [PATCH net 1/2] batman-adv: Fix change mac address of soft iface Antonio Quartulli 2012-09-25 16:01 ` pull request: batman-adv 2012-09-25 Antonio Quartulli @ 2012-09-25 17:25 ` David Miller 2 siblings, 0 replies; 6+ messages in thread From: David Miller @ 2012-09-25 17:25 UTC (permalink / raw) To: ordex-GaUfNO9RBHfsrOwW+9ziJQ Cc: netdev-u79uwXL29TY76Z2rM5mHXA, b.a.t.m.a.n-ZwoEplunGu2X36UT3dwllkB+6BGkLq7r From: Antonio Quartulli <ordex-GaUfNO9RBHfsrOwW+9ziJQ@public.gmane.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. ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2012-09-28 18:42 UTC | newest] Thread overview: 6+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2012-09-25 15:57 pull request: batman-adv 2012-09-25 Antonio Quartulli 2012-09-25 15:57 ` [PATCH net 2/2] batman-adv: Fix symmetry check / route flapping in multi interface setups Antonio Quartulli [not found] ` <1348588637-18441-1-git-send-email-ordex-GaUfNO9RBHfsrOwW+9ziJQ@public.gmane.org> 2012-09-25 15:57 ` [PATCH net 1/2] batman-adv: Fix change mac address of soft iface Antonio Quartulli 2012-09-25 16:01 ` pull request: batman-adv 2012-09-25 Antonio Quartulli [not found] ` <20120925160119.GA31069-E/2OGukznS5g9hUCZPvPmw@public.gmane.org> 2012-09-28 18:42 ` David Miller 2012-09-25 17:25 ` David Miller
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).