From patchwork Mon Oct 17 12:25:13 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Antonio Quartulli X-Patchwork-Id: 1280 Return-Path: Received: from confino.investici.org (investici.nine.ch [217.150.252.179]) by open-mesh.org (Postfix) with ESMTPS id B10B16007D2 for ; Mon, 17 Oct 2011 14:26:13 +0200 (CEST) Authentication-Results: open-mesh.org; dkim=pass (1024-bit key) header.i=@autistici.org; dkim-adsp=pass Received: from [217.150.252.179] (confino [217.150.252.179]) (Authenticated sender: ordex@autistici.org) by localhost (Postfix) with ESMTPSA id E31CDC8656; Mon, 17 Oct 2011 12:26:12 +0000 (UTC) X-DKIM: Sendmail DKIM Filter v2.8.2 confino.investici.org E31CDC8656 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=autistici.org; s=stigmate; t=1318854373; bh=uobC9XJE3axqyp7crEF1474LrcNeOEBrIK3V3dhZlVQ=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References; b=bPq1CRS/fVHDTy0/dncWKeuPz7cU1XBkc4ED8b7Nu16oj45ewsi0ovMiOFsZcjyHY rumPnFe7TrWGOo2moWeymQVmt/eMws2DBm4Tm13wyKx3aWezt2OuWG4IrCDAW6mvsT xTmJ4MNdxbPogKLNDgMYmFCaP5CZW4QR3YDaOIx4= From: Antonio Quartulli To: b.a.t.m.a.n@lists.open-mesh.org Date: Mon, 17 Oct 2011 14:25:13 +0200 Message-Id: <1318854313-2264-1-git-send-email-ordex@autistici.org> X-Mailer: git-send-email 1.7.3.4 In-Reply-To: <1318513370-9868-1-git-send-email-ordex@autistici.org> References: <1318513370-9868-1-git-send-email-ordex@autistici.org> Subject: [B.A.T.M.A.N.] [PATCHv2] batman-adv: correctly set the data field in the TT_REPONSE packet 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: Mon, 17 Oct 2011 12:26:13 -0000 In the TT_RESPONSE packet, the number of carried entries is not correctly set. This leads to a wrong interpretation of the packet payload on the receiver side causing random entries to be added to the global translation table. Therefore the latter gets always corrupted, triggering a table recovery all the time. Signed-off-by: Antonio Quartulli --- translation-table.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/translation-table.c b/translation-table.c index 2d2cfc1..1867336 100644 --- a/translation-table.c +++ b/translation-table.c @@ -1054,7 +1054,6 @@ static struct sk_buff *tt_response_fill_table(uint16_t tt_len, uint8_t ttvn, tt_response = (struct tt_query_packet *)skb_put(skb, tt_query_size + tt_len); tt_response->ttvn = ttvn; - tt_response->tt_data = htons(tt_tot); tt_change = (struct tt_change *)(skb->data + tt_query_size); tt_count = 0; @@ -1080,6 +1079,10 @@ static struct sk_buff *tt_response_fill_table(uint16_t tt_len, uint8_t ttvn, } rcu_read_unlock(); + /* store in the message the number of entries we have successfully + * copied */ + tt_response->tt_data = htons(tt_count); + out: return skb; }