All of lore.kernel.org
 help / color / mirror / Atom feed
* [B.A.T.M.A.N.] [RFC PATCH] batman-adv: mitigate issue when empty vlan is received
@ 2018-05-06 19:55 Leonardo Mörlein
  2018-05-07  6:32 ` Sven Eckelmann
                   ` (3 more replies)
  0 siblings, 4 replies; 16+ messages in thread
From: Leonardo Mörlein @ 2018-05-06 19:55 UTC (permalink / raw)
  To: b.a.t.m.a.n; +Cc: Leonardo Mörlein

This patch is not a fix for the issue itself, but a fix for the
other nodes, which are also influenced by the issue.

- Some (affected) nodes send TT announcements for an empty vlan (for
  now only seen with vlan_id = 0).
- This behaviour is a bug! Batman-adv nodes must not send TT
  announcements for empty vlans.
- The receiving batman-adv can not handle incoming TT announcements
  with empty vlans. (The crc check routine batadv_tt_global_check_crc()
  fails.)
- As the receiving node thinks, the crc is broken, it does a full
  table request then.
- The announcing node sends a TT full table to the receiving node
  then, which also contains the empty vlan, so
  *batadv_tt_global_check_crc()* fails again on the receiver side.
- This causes a lot of unneeded TT traffic. In Freifunk Hannover we
  decreased the amount of from ~20kpp/s to ~4kpp/s on our supernodes.
  We have ~800 nodes, which are connected via vpn to one of six
  supernodes. Those supernodes are connected with each other in a fully
  connected mesh.

Signed-off-by: Leonardo Mörlein <me@irrelefant.net>
---
 net/batman-adv/translation-table.c | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)

diff --git a/net/batman-adv/translation-table.c b/net/batman-adv/translation-table.c
index 0225616d..d2a843fd 100644
--- a/net/batman-adv/translation-table.c
+++ b/net/batman-adv/translation-table.c
@@ -2996,8 +2996,21 @@ static bool batadv_tt_global_check_crc(struct batadv_orig_node *orig_node,
 
 		vlan = batadv_orig_node_vlan_get(orig_node,
 						 ntohs(tt_vlan_tmp->vid));
-		if (!vlan)
-			return false;
+		if (!vlan) {
+			/* Due to a bug, some originators send TT
+			 * announcements for empty vlans. As the receiving
+			 * nodes will ignore those empty vlans (they do not
+			 * add a batadv_orig_node_vlan into the transglobal
+			 * for the originating node), crc check will fail
+			 * here. To circumvent this issue, we skip the
+			 * verification for the vlan if the crc is
+			 * equal to 0x00000000.
+			 */
+			if (tt_vlan_tmp->crc == 0x00000000)
+				continue;
+			else
+				return false;
+		}
 
 		crc = vlan->tt.crc;
 		batadv_orig_node_vlan_put(vlan);
-- 
2.17.0


^ permalink raw reply related	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2018-05-11 15:58 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-06 19:55 [B.A.T.M.A.N.] [RFC PATCH] batman-adv: mitigate issue when empty vlan is received Leonardo Mörlein
2018-05-07  6:32 ` Sven Eckelmann
2018-05-07  8:06   ` me
2018-05-07 10:23     ` Sven Eckelmann
2018-05-08  8:45       ` Sven Eckelmann
2018-05-09 14:08 ` Marek Lindner
2018-05-09 16:06 ` [B.A.T.M.A.N.] [RFC] batman-adv: prevent TT request storms by not sending inconsistent TT TLVLs Marek Lindner
2018-05-09 17:21   ` Sven Eckelmann
2018-05-09 18:20     ` Sven Eckelmann
2018-05-09 20:38       ` Sven Eckelmann
2018-05-09 21:34         ` lemoer
2018-05-10  9:12         ` Antonio Quartulli
2018-05-10 10:28       ` Marek Lindner
2018-05-10 14:41 ` [B.A.T.M.A.N.] [RFC v2] " Marek Lindner
2018-05-10 15:50   ` Sven Eckelmann
2018-05-11 15:58     ` Marek Lindner

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.