From patchwork Sat Nov 26 14:26:47 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Lindner X-Patchwork-Id: 1380 Return-Path: Received: from nm11.bullet.mail.ukl.yahoo.com (nm11.bullet.mail.ukl.yahoo.com [217.146.183.185]) by open-mesh.org (Postfix) with SMTP id 89564600874 for ; Sat, 26 Nov 2011 15:29:13 +0100 (CET) Authentication-Results: open-mesh.org; dkim=pass (1024-bit key) header.i=@yahoo.de; dkim-adsp=none Received: from [217.146.183.216] by nm11.bullet.mail.ukl.yahoo.com with NNFMP; 26 Nov 2011 14:29:13 -0000 Received: from [77.238.184.74] by tm9.bullet.mail.ukl.yahoo.com with NNFMP; 26 Nov 2011 14:29:13 -0000 Received: from [127.0.0.1] by smtp143.mail.ukl.yahoo.com with NNFMP; 26 Nov 2011 14:29:13 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.de; s=s1024; t=1322317753; bh=LVQ2maHJsn4/EKfHuGBocXaOI7NpaupQbA2MtcOa91A=; h=X-Yahoo-Newman-Id:X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:Received:From:To:Cc:Subject:Date:Message-Id:X-Mailer:In-Reply-To:References; b=R4Ci6BG8wAF7jhFpOiCKjQeORa43X81hXL8DpfWkMxYeIijTfOaLa1xEtiOusan/HBki6qlk/qu2YbrPvM5MQpaDiQ+yVXXD8nuGwsSHZDU/zZb6SMhngGvHrA57zsYv1Z01+CIenE1+7t3epW//z3tHBWkYYJe7Mikk2K77Gxg= X-Yahoo-Newman-Id: 247362.97309.bm@smtp143.mail.ukl.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: NqNwfwQVM1mZmzq1KuhHV.r6TJmuEgKJ1UhfS5czHtbDg_L TkSe87rEc813eHkmSHzVQTQ0wKRl.ecXXR5H7NjphaVeof8bfOt9kAjd7XdA DmHoopqc9dbbeY5vv9IhLivhZ9YgtitcVzvRAMfG2j0CHgT9LrzLrn3tVFzD 5FY3.1KFa7MvwZETWA2vT3VAFNrAntybgAH3gNLbY9r6Uv6G0cBX6TvYwKn9 0ckPzn2aM7BYlIROnZ.cUSmEtC1jSflefewV6LBKEotAJBmcNIh8KKLcmkio 0o65flAfqZ_fQso94He8U8CdXc55btEbJ1m0s8LhhyCYsCEZKCA.IeFjpvTX bgIqLxvCkzhQc7AVc.6LmjbUtcItCxZS7Gh5.QTC0nxKBiTYUIWS5rw-- X-Yahoo-SMTP: tW.h3tiswBBMXO2coYcbPigGD5Lt6zY_.Zc- Received: from localhost (lindner_marek@210.177.7.38 with plain) by smtp143.mail.ukl.yahoo.com with SMTP; 26 Nov 2011 14:29:09 +0000 GMT From: Marek Lindner To: davem@davemloft.net Date: Sat, 26 Nov 2011 22:26:47 +0800 Message-Id: <1322317612-7770-6-git-send-email-lindner_marek@yahoo.de> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1322317612-7770-1-git-send-email-lindner_marek@yahoo.de> References: <1322317612-7770-1-git-send-email-lindner_marek@yahoo.de> Cc: netdev@vger.kernel.org, b.a.t.m.a.n@lists.open-mesh.org Subject: [B.A.T.M.A.N.] [PATCH 05/10] 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: Sat, 26 Nov 2011 14:29:13 -0000 From: Antonio Quartulli get_orig_node() tries to retrieve an orig_node object based on a mac address and creates it if not present. This is not the wanted behaviour in the translation table code as we don't want to create new orig_code objects but expect a NULL pointer if the object does not exist. Reported-by: Simon Wunderlich Signed-off-by: Antonio Quartulli Signed-off-by: Sven Eckelmann --- net/batman-adv/translation-table.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/net/batman-adv/translation-table.c b/net/batman-adv/translation-table.c index 1db9d96..7ab9d72 100644 --- a/net/batman-adv/translation-table.c +++ b/net/batman-adv/translation-table.c @@ -1188,11 +1188,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; @@ -1318,7 +1318,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;