openwrt-routing/patches/0003-batman-adv_do_not_add_...

92 lines
4.3 KiB
Diff

From ordex@autistici.org Fri Nov 16 16:49:17 2012
X-Apparently-To: lindner_marek@yahoo.de via 188.125.84.191; Fri, 16 Nov 2012 08:50:23 +0000
Received-SPF: pass (domain of autistici.org designates 178.255.144.35 as permitted sender)
X-YMailISG: 2XUGKvsWLDvGA03t6tTkIRd1IgFM3maQM0m2SA6K1X6dTDIs
22VSgKM.DhxAYBiW3Da9K.oH5o6C953_nJPPhur2qBPO.O3cDwjef5_Ugpc9
EToptn4WCMI_3P8HITy2vYKCSg9Ycsqx9qqZUyxR_6Q1muNYxPYlaakcwXc.
1ohYca223PQlYfbpn4rBdIT0Hf67oGZa12E_u.UgRAk80txi2mSPmlwJi1v7
tUv907MDZ5psHzC7gI1A8TiWoRgSe3M68t8k8V.MEHOgITRKJ2fZshNFNdca
lrgJos7q8MPEccQhwYN.VInpv9loDuyCJLgx.seZFqgkKyQ81g0VeT_lZMp.
cXmi1p0etSsdGUkOn7MFKt1dzIoq46ebW1FRMW0RBIecunHshbqZS425M5sa
6DJ.WZpYRxXqD2osYHboWzcz6Oi02o7r.XwFwyz55p2Hq992vZ06vJd3FQF1
OmHf014Ni4fKu4au2M8b_fy2bqaSMYNdYIWSPrOzRpVOvQmU6eNJZz9TTaWw
p.giBbKH3qDhw6sn3HtEVZwsrOjNvLiccPeRmHXXp_3cVDy9iO0a2WhEsPyG
HnjeV08RB4j2JuICHcFo68rbC5x6MHkKXc.f4bDQ9KqzmX_av7jotSW2jPHa
eqXDV0tiP1TbuZNBo9ftz367Aver9BvjM3qZOGg2VVAy2FriP4hbbLzAkK7p
oReYyFnOjkbHpXOFkgcMiEZyTYNoD3rsWT68YOLl74dgYraLrIY4Sv0e8bHJ
5u3v1aHhPNtjKNBxnd2xSSdgblb._mebG3fP1eKBGgil_efLA0cnvskj2w_z
BOCCHWCDYadM8RIkSB3XWkKtjkDZFwzXPEco7DuNhCKvTycFnZ_ilaJTmMSg
juyzcelGzKqOftqt5f1dRKUMSg2JFIv0pwZt4W.DGS4P_SqbWLEShjrxbwEc
b7ew9lr_iukbFzL4uN49A4uFx.J8c2WaZDv1gXvRZEiIHbdkKxlHdVyTuQ05
aLLDc7Mz9Y68Z7msdzKK8V5LdRqdtCzFogk9seViWAVYXdndAn7XT22cOgci
IhdVk8RULmZ5uouAMr0usTIH_MKtCdInt1Tn.DlGuUEeDw2M5SeSC7cKPETl
lnSu5f8p6_ei9sx7YwdIQDyOG2o_49xM4Oeekeh9x3dGq23BvAEa8Q--
X-Originating-IP: [178.255.144.35]
Authentication-Results: mta1054.mail.ukl.yahoo.com from=autistici.org; domainkeys=neutral (no sig); from=autistici.org; dkim=pass (ok)
Received: from 127.0.0.1 (EHLO contumacia.investici.org) (178.255.144.35)
by mta1054.mail.ukl.yahoo.com with SMTP; Fri, 16 Nov 2012 08:50:23 +0000
Received: from [178.255.144.35] (contumacia [178.255.144.35]) (Authenticated sender: ordex@autistici.org) by localhost (Postfix) with ESMTPSA id AD953E8786;
Fri, 16 Nov 2012 08:50:21 +0000 (UTC)
X-DKIM: Sendmail DKIM Filter v2.8.2 contumacia.investici.org AD953E8786
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=autistici.org;
s=stigmate; t=1353055823;
bh=Rf2TK97MqcbN9ydt5/Ur6XKfsKU31Fnc1POW6n859o4=;
h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References;
b=rOZmgwiyXClabfKLMxvEs9cRsEGiS0CPOTPna1OmakChF1i9/CFcKollV1xOp8g/h
UJMy7F82OyIBYptUTcTXfvQSUD7Lh92tbrWwkAmq3/1CeqKCrcuk5DNhaQYgoKfDpT
qg6uTDtM5bFM21xzsl/0itBJUeRv6y+FQT4mOQeI=
From: Antonio Quartulli <ordex@autistici.org>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org,
Simon Wunderlich <simon.wunderlich@s2003.tu-chemnitz.de>,
Marek Lindner <lindner_marek@yahoo.de>,
Sven Eckelmann <sven@narfation.org>,
Antonio Quartulli <ordex@autistici.org>
Subject: [PATCH] batman-adv: don't add TEMP clients belonging to other backbone nodes
Date: Fri, 16 Nov 2012 09:49:17 +0100
Message-Id: <1353055758-2901-4-git-send-email-ordex@autistici.org>
X-Mailer: git-send-email 1.8.0
In-Reply-To: <1353055758-2901-1-git-send-email-ordex@autistici.org>
References: <1353055758-2901-1-git-send-email-ordex@autistici.org>
Status: R
X-Status: N
X-KMail-EncryptionState:
X-KMail-SignatureState:
X-KMail-MDN-Sent:
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 | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/translation-table.c b/translation-table.c
index fec1a00..baae715 100644
--- a/translation-table.c
+++ b/translation-table.c
@@ -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)))
--
1.8.0