b.a.t.m.a.n.lists.open-mesh.org archive mirror
 help / color / mirror / Atom feed
From: Marek Lindner <lindner_marek@yahoo.de>
To: davem@davemloft.net
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
Date: Sat, 26 Nov 2011 22:26:47 +0800	[thread overview]
Message-ID: <1322317612-7770-6-git-send-email-lindner_marek@yahoo.de> (raw)
In-Reply-To: <1322317612-7770-1-git-send-email-lindner_marek@yahoo.de>

From: Antonio Quartulli <ordex@autistici.org>

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 <siwu@hrz.tu-chemnitz.de>
Signed-off-by: Antonio Quartulli <ordex@autistici.org>
Signed-off-by: Sven Eckelmann <sven@narfation.org>
---
 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;
 
-- 
1.7.5.4


  parent reply	other threads:[~2011-11-26 14:26 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-26 14:26 [B.A.T.M.A.N.] pull request: batman-adv 2011-11-26 Marek Lindner
2011-11-26 14:26 ` [B.A.T.M.A.N.] [PATCH 01/10] batman-adv: update internal version number Marek Lindner
2011-11-26 14:26 ` [B.A.T.M.A.N.] [PATCH 02/10] batman-adv: tt_global_del_orig() has to print the correct message Marek Lindner
2011-11-26 14:26 ` [B.A.T.M.A.N.] [PATCH 03/10] batman-adv: Replace obsolete strict_strto<foo> with kstrto<foo> Marek Lindner
2011-11-26 14:26 ` [B.A.T.M.A.N.] [PATCH 04/10] batman-adv: refactoring gateway handling code Marek Lindner
2011-11-26 14:26 ` Marek Lindner [this message]
2011-11-26 14:26 ` [B.A.T.M.A.N.] [PATCH 06/10] batman-adv: fixed hash functions type to uint32_t instead of int Marek Lindner
2011-11-26 14:26 ` [B.A.T.M.A.N.] [PATCH 07/10] batman-adv: directly write tt entries without buffering Marek Lindner
2011-11-26 14:26 ` [B.A.T.M.A.N.] [PATCH 08/10] batman-adv: linearise the tt_response skb only if needed Marek Lindner
2011-11-26 14:26 ` [B.A.T.M.A.N.] [PATCH 09/10] batman-adv: check for tt_reponse packet real length Marek Lindner
2011-11-26 14:26 ` [B.A.T.M.A.N.] [PATCH 10/10] batman-adv: Fix range check for expected packets Marek Lindner
2011-11-26 19:41 ` [B.A.T.M.A.N.] pull request: batman-adv 2011-11-26 David Miller
2011-12-02 17:12   ` Antonio Quartulli
2011-12-02 17:57     ` David Miller
2011-12-03  1:55       ` Antonio Quartulli
2011-12-03  1:59         ` David Miller
2011-12-03  8:55           ` Sven Eckelmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1322317612-7770-6-git-send-email-lindner_marek@yahoo.de \
    --to=lindner_marek@yahoo.de \
    --cc=b.a.t.m.a.n@lists.open-mesh.org \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).