From patchwork Wed Oct 12 12:54:50 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Antonio Quartulli X-Patchwork-Id: 1284 Return-Path: Received: from contumacia.investici.org (contumacia.investici.org [178.255.144.35]) by open-mesh.org (Postfix) with ESMTPS id 1A0396006A8 for ; Wed, 12 Oct 2011 14:55:43 +0200 (CEST) Authentication-Results: open-mesh.org; dkim=pass (1024-bit key) header.i=@autistici.org; dkim-adsp=pass Received: from [178.255.144.35] (contumacia [178.255.144.35]) (Authenticated sender: ordex@autistici.org) by localhost (Postfix) with ESMTPSA id 391D3E84CA; Wed, 12 Oct 2011 12:55:41 +0000 (UTC) X-DKIM: Sendmail DKIM Filter v2.8.2 contumacia.investici.org 391D3E84CA DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=autistici.org; s=stigmate; t=1318424142; bh=hmZZo8+IWUDPIXMQskKcXFN7wVpgyi69fwmF3AawBJY=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References; b=WGZw/di0WZH0GPzdr94qZhNUWVChI1MPAy5EIPYC7UrAvJkSlk3KPysGUSEG0cd+A ejXlNlWI8b48q2v0c607zOczG8yzCh2A7W9/1BeIg4eCQrLUa1Iu+iRl9+QeRl4128 Hotjl/0O1eDu4DC4z+D/xdR9YCj/bMsHgH3pKD90= From: Antonio Quartulli To: b.a.t.m.a.n@lists.open-mesh.org Date: Wed, 12 Oct 2011 14:54:50 +0200 Message-Id: <1318424090-22862-1-git-send-email-ordex@autistici.org> X-Mailer: git-send-email 1.7.3.4 In-Reply-To: <1318249725-19865-1-git-send-email-ordex@autistici.org> References: <1318249725-19865-1-git-send-email-ordex@autistici.org> Subject: [B.A.T.M.A.N.] [PATCHv2] batman-adv: use orig_hash_find() instead of get_orig_node() in TT code X-BeenThere: b.a.t.m.a.n@lists.open-mesh.org X-Mailman-Version: 2.1.13 Precedence: list Reply-To: The list for a Better Approach To Mobile Ad-hoc Networking List-Id: The list for a Better Approach To Mobile Ad-hoc Networking List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Oct 2011 12:55:43 -0000 get_orig_node() tries to retrieves an orig_node object and possibly creates it if not present. This is not the wanted behaviours in the translation-table code, instead we want to get the orig_node only if it really exists, without creating it. Reported-by: Simon Wunderlich Signed-off-by: Antonio Quartulli --- translation-table.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/translation-table.c b/translation-table.c index 7de9960..6102cd2 100644 --- a/translation-table.c +++ b/translation-table.c @@ -1170,11 +1170,11 @@ static bool send_other_tt_response(struct bat_priv *bat_priv, (tt_request->flags & TT_FULL_TABLE ? 'F' : '.')); /* Let's get the orig node of the REAL destination */ - req_dst_orig_node = get_orig_node(bat_priv, tt_request->dst); + req_dst_orig_node = orig_hash_find(bat_priv, tt_request->dst); if (!req_dst_orig_node) goto out; - res_dst_orig_node = get_orig_node(bat_priv, tt_request->src); + res_dst_orig_node = orig_hash_find(bat_priv, tt_request->src); if (!res_dst_orig_node) goto out; @@ -1300,7 +1300,7 @@ static bool send_my_tt_response(struct bat_priv *bat_priv, my_ttvn = (uint8_t)atomic_read(&bat_priv->ttvn); req_ttvn = tt_request->ttvn; - orig_node = get_orig_node(bat_priv, tt_request->src); + orig_node = orig_hash_find(bat_priv, tt_request->src); if (!orig_node) goto out;