b.a.t.m.a.n.lists.open-mesh.org archive mirror
 help / color / mirror / Atom feed
From: Simon Wunderlich <simon.wunderlich@s2003.tu-chemnitz.de>
To: b.a.t.m.a.n@lists.open-mesh.org, Antonio Quartulli <ordex@autistici.org>
Subject: [B.A.T.M.A.N.] [PATCH] batman-adv: fix initialised flag for tt request/responses
Date: Sun, 22 Jan 2012 14:15:53 +0100	[thread overview]
Message-ID: <1327238153-8303-1-git-send-email-siwu@hrz.tu-chemnitz.de> (raw)

When receiving a tt_response, we first delete the old entries and
set the initialised flag to false, then add the new received entries,
but forgot to set the initialised flag to true again. This may lead to
endless loops of requests/responses, as a request is always issued
if the initialised flag is not set.

Fix this by moving initialised = true from tt_update_changes() to
_tt_update_changes().

Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
---
 translation-table.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/translation-table.c b/translation-table.c
index 27753a0..9a6f315 100644
--- a/translation-table.c
+++ b/translation-table.c
@@ -1434,6 +1434,7 @@ static void _tt_update_changes(struct bat_priv *bat_priv,
 				 */
 				return;
 	}
+	orig_node->tt_initialised = true;
 }
 
 static void tt_fill_gtable(struct bat_priv *bat_priv,
@@ -1476,7 +1477,6 @@ static void tt_update_changes(struct bat_priv *bat_priv,
 	tt_save_orig_buffer(bat_priv, orig_node, (unsigned char *)tt_change,
 			    tt_num_changes);
 	atomic_set(&orig_node->last_ttvn, ttvn);
-	orig_node->tt_initialised = true;
 }
 
 bool is_my_client(struct bat_priv *bat_priv, const uint8_t *addr)
-- 
1.7.8.3


             reply	other threads:[~2012-01-22 13:15 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-22 13:15 Simon Wunderlich [this message]
2012-01-22 16:26 ` [B.A.T.M.A.N.] [PATCH] batman-adv: fix initialised flag for tt request/responses Marek Lindner
2012-01-22 18:40   ` [B.A.T.M.A.N.] [PATCHv2] " Simon Wunderlich
2012-01-26 20:34     ` Marek Lindner

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=1327238153-8303-1-git-send-email-siwu@hrz.tu-chemnitz.de \
    --to=simon.wunderlich@s2003.tu-chemnitz.de \
    --cc=b.a.t.m.a.n@lists.open-mesh.org \
    --cc=ordex@autistici.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).