Skip to contentSkip to conversation

batman-adv: prevent adding of loop detection mac addresses to global tt

PATCH In review Andreas Pape 2 participants 3 messages Jun 1, 2017 Batman advanced

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 batman-adv: prevent adding of loop detection mac addresses to global tt

This patch prevents that entries in the global translation table are generated for mac addresses used by loop detection frames.

---
 net/batman-adv/translation-table.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
net/batman-adv/translation-table.c +4 -2
index e75b493..ca1e0f7 100644
@@ -1618,8 +1618,10 @@ static bool batadv_tt_global_add(struct batadv_priv *bat_priv,
 	struct batadv_tt_common_entry *common;
 	u16 local_flags;
 
-	/* ignore global entries from backbone nodes */
-	if (batadv_bla_is_backbone_gw_orig(bat_priv, orig_node->orig, vid))
+	/* ignore global entries from backbone nodes or
+	 * adding of entries related to loop detect frames */
+	if (batadv_bla_is_backbone_gw_orig(bat_priv, orig_node->orig, vid) ||
+		batadv_bla_is_loopdetect_mac(tt_addr))
 		return true;
 
 	tt_global_entry = batadv_tt_global_hash_find(bat_priv, tt_addr, vid);

--
1.7.0.4

..................................................................
PHOENIX CONTACT ELECTRONICS GmbH

Sitz der Gesellschaft / registered office of the company: 31812 Bad Pyrmont
USt-Id-Nr.: DE811742156
Amtsgericht Hannover HRB 100528 / district court Hannover HRB 100528
Geschäftsführer / Executive Board: Ulrich Leidecker, Christoph Leifer
__________________________________________________________________
Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtümlich erhalten haben, informieren Sie bitte sofort den Absender und vernichten Sie diese Mail. Das unerlaubte Kopieren, jegliche anderweitige Verwendung sowie die unbefugte Weitergabe dieser Mail ist nicht gestattet.
----------------------------------------------------------------------------------------------------
This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure, distribution or other use of the material or parts thereof is strictly forbidden.
___________________________________________________________________

maintainer
#1 lore raw
Quoted 15 lines · CEST Andreas Pape

This patch prevents that entries in the global translation table are generated for mac addresses used by loop detection frames.

---
 net/batman-adv/translation-table.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
(quoted diff) +0 -0

b/net/batman-adv/translation-table.c index e75b493..ca1e0f7 100644

net/batman-adv/translation-table.c +0 -0
@@ -1618,8 +1618,10 @@ static bool batadv_tt_global_add(struct batadv_priv
 *bat_priv, struct batadv_tt_common_entry *common;
 	u16 local_flags;

net/batman-adv/translation-table.c static bool batadv_tt_global_add(struct batadv_priv · line 1627

Quoted 10 lines
net/batman-adv/translation-table.c +4 -2
 
-	/* ignore global entries from backbone nodes */
-	if (batadv_bla_is_backbone_gw_orig(bat_priv, orig_node->orig, vid))
+	/* ignore global entries from backbone nodes or
+	 * adding of entries related to loop detect frames */
+	if (batadv_bla_is_backbone_gw_orig(bat_priv, orig_node->orig, vid) ||
+		batadv_bla_is_loopdetect_mac(tt_addr))
 		return true;
 
 	tt_global_entry = batadv_tt_global_hash_find(bat_priv, tt_addr, vid);

Thank you for your patch.

I was thinking, if we implement it like this we may still have problems if an older batman-adv version is adding the ba:be mac addresses locally. This could create a problem, because the transmitted tt table is not added completely, thus the CRC will not match and will lead to a "TT request/response loop".

What do you think? Maybe we should only add it for the speedy join case, but accept it if a node really added these mac addresses locally?

Thanks,
Simon

#2 lore raw

[B.A.T.M.A.N.] Antwort: Re: [PATCH] batman-adv: prevent adding of loop detection mac addresses to global tt

Hi Simon,

Quoted 2 lines

I was thinking, if we implement it like this we may still have problems

if an

Quoted 3 lines

older batman-adv version is adding the ba:be mac addresses locally. This could
create a problem, because the transmitted tt table is not added

completely,

Quoted 1 line

thus the CRC will not match and will lead to a "TT request/response

loop".

Quoted 2 lines

What do you think? Maybe we should only add it for the speedy join case,

but

Quoted 1 line

accept it if a node really added these mac addresses locally?

I'm afraid I haven't understood the speedy join mechanism / use case good enough
to make a good proposal here, but I'm volunteering for testing if someone else
has a better solution then my rough approach ;-)

Kind regards,
Andreas

..................................................................
PHOENIX CONTACT ELECTRONICS GmbH

Sitz der Gesellschaft / registered office of the company: 31812 Bad Pyrmont
USt-Id-Nr.: DE811742156
Amtsgericht Hannover HRB 100528 / district court Hannover HRB 100528
Geschäftsführer / Executive Board: Ulrich Leidecker, Christoph Leifer
__________________________________________________________________
Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtümlich erhalten haben, informieren Sie bitte sofort den Absender und vernichten Sie diese Mail. Das unerlaubte Kopieren, jegliche anderweitige Verwendung sowie die unbefugte Weitergabe dieser Mail ist nicht gestattet.
----------------------------------------------------------------------------------------------------
This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure, distribution or other use of the material or parts thereof is strictly forbidden.
___________________________________________________________________