batman-adv: don't add TEMP clients belonging to other backbone nodes
authorAntonio Quartulli <ordex@autistici.org>
Thu, 8 Nov 2012 20:55:29 +0000 (21:55 +0100)
committerAntonio Quartulli <ordex@autistici.org>
Fri, 16 Nov 2012 08:36:43 +0000 (09:36 +0100)
The "early client detection" mechanism must not add clients belonging
to other backbone nodes. Such clients must be reached by directly
using the LAN instead of the mesh.

This was introduced by 30cfd02b60e1cb16f5effb0a01f826c5bb7e4c59
("batman-adv: detect not yet announced clients")

Reported-by: Glen Page <glen.page@thet.net>
Signed-off-by: Antonio Quartulli <ordex@autistici.org>
Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
net/batman-adv/translation-table.c

index fec1a00a069963dba4aacd90cf2de9db4b2e4d26..baae71585804313ff406aad0ab7f04b0b7daa189 100644 (file)
@@ -2456,6 +2456,13 @@ bool batadv_tt_add_temporary_global_entry(struct batadv_priv *bat_priv,
 {
        bool ret = false;
 
+       /* if the originator is a backbone node (meaning it belongs to the same
+        * LAN of this node) the temporary client must not be added because to
+        * reach such destination the node must use the LAN instead of the mesh
+        */
+       if (batadv_bla_is_backbone_gw_orig(bat_priv, orig_node->orig))
+               goto out;
+
        if (!batadv_tt_global_add(bat_priv, orig_node, addr,
                                  BATADV_TT_CLIENT_TEMP,
                                  atomic_read(&orig_node->last_ttvn)))