From patchwork Sun Jan 22 13:15:53 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Wunderlich X-Patchwork-Id: 1470 Return-Path: Received: from cora.hrz.tu-chemnitz.de (cora.hrz.tu-chemnitz.de [134.109.228.40]) by open-mesh.org (Postfix) with ESMTPS id 57BE46006F5 for ; Sun, 22 Jan 2012 14:15:54 +0100 (CET) Authentication-Results: open-mesh.org; dkim=pass (1024-bit key) header.i=@tu-chemnitz.de; dkim-adsp=none DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tu-chemnitz.de; s=dkim2010; h=Message-Id:Date:Subject:To:From; bh=JsuXVB69tjtgSnB33t13xe3FULEqPeMiUsBaBDB8IXo=; b=e5a8WFxUQ3cBvC4m30fIGwucBqoo5L6HBwDPP7bkdQEml1BYTNQMBbpbuwEOoXU+XkFHhpV4S9o7gR5+Cbg9k1zjbqilRr8oAox5VEQL20VylzI8A/WuTh2kvI+sLy25jUkqS++6xborpIonZlaqtlxxc01Un5j4guj97T68/HA=; Received: from p57aa022b.dip0.t-ipconnect.de ([87.170.2.43] helo=pandem0nium) by cora.hrz.tu-chemnitz.de with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.76) (envelope-from ) id 1RoxGz-0000az-Il; Sun, 22 Jan 2012 14:15:53 +0100 Received: from dotslash by pandem0nium with local (Exim 4.72) (envelope-from ) id 1RoxGz-0002AS-Bu; Sun, 22 Jan 2012 14:15:53 +0100 From: Simon Wunderlich To: b.a.t.m.a.n@lists.open-mesh.org, Antonio Quartulli Date: Sun, 22 Jan 2012 14:15:53 +0100 Message-Id: <1327238153-8303-1-git-send-email-siwu@hrz.tu-chemnitz.de> X-Mailer: git-send-email 1.7.2.5 X-RBL-Warning: 87.170.2.43 is listed at zen.spamhaus.org X-Scan-AV: cora.hrz.tu-chemnitz.de; 2012-01-22 14:15:53; 015b202639fbf77caec0907a98f61224 X-Scan-SA: cora.hrz.tu-chemnitz.de; 2012-01-22 14:15:53; 597bebc2e60c8db4e4ad9ccb39fe92dc X-Spam-Score: 1.5 (+) X-Spam-Report: --- Textanalyse SpamAssassin 3.3.1 (1.5 Punkte) Fragen an/questions to: Postmaster TU Chemnitz * -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP * 2.5 TUC_RBL RBL: Mail von bekanntem Spam-Relay oder Dialup (TUC) --- Ende Textanalyse Subject: [B.A.T.M.A.N.] [PATCH] batman-adv: fix initialised flag for tt request/responses 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: Sun, 22 Jan 2012 13:15:54 -0000 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 --- 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)