From patchwork Wed Apr 18 09:59:58 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Antonio Quartulli X-Patchwork-Id: 1795 Return-Path: Received: from confino.investici.org (investici.nine.ch [217.150.252.179]) by open-mesh.org (Postfix) with ESMTPS id 086B960085C for ; Wed, 18 Apr 2012 11:59:22 +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 2CAB9C8683; Wed, 18 Apr 2012 09:59:21 +0000 (UTC) X-DKIM: Sendmail DKIM Filter v2.8.2 confino.investici.org 2CAB9C8683 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=autistici.org; s=stigmate; t=1334743161; bh=5U+PjqORZ0T0Ugbocog6zX20nEgqUzBxtXIhs9fcgpw=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References; b=MaUt64hzQ99I2v9nl6D/+tFmGnATXBHdIAhUYZdso0gGIBcPT+EsaN4zDzJoNujYx ZSEjX45Y62EWNYZdBJP+AqXSCZmN28gWPO/tyXURGmIVFfp56p8dmuCHmRgqNfmJG9 qoJ9nDOVi58OQO1StK9HA4+aDjvG8FNsgzDDTPd0= From: Antonio Quartulli To: davem@davemloft.net Date: Wed, 18 Apr 2012 11:59:58 +0200 Message-Id: <1334743210-12338-2-git-send-email-ordex@autistici.org> X-Mailer: git-send-email 1.7.9.4 In-Reply-To: <1334743210-12338-1-git-send-email-ordex@autistici.org> References: <1334743210-12338-1-git-send-email-ordex@autistici.org> Cc: netdev@vger.kernel.org, b.a.t.m.a.n@lists.open-mesh.org Subject: [B.A.T.M.A.N.] [PATCH 01/13] batman-adv: convert the tt_crc to network order 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: Wed, 18 Apr 2012 09:59:23 -0000 Before sending out a TT_Request packet we must convert the tt_crc field value to network order (since it is 16bits long). Reported-by: Al Viro Signed-off-by: Antonio Quartulli --- net/batman-adv/translation-table.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/batman-adv/translation-table.c b/net/batman-adv/translation-table.c index e16a369..a38d315 100644 --- a/net/batman-adv/translation-table.c +++ b/net/batman-adv/translation-table.c @@ -1339,7 +1339,7 @@ static int send_tt_request(struct bat_priv *bat_priv, memcpy(tt_request->dst, dst_orig_node->orig, ETH_ALEN); tt_request->header.ttl = TTL; tt_request->ttvn = ttvn; - tt_request->tt_data = tt_crc; + tt_request->tt_data = htons(tt_crc); tt_request->flags = TT_REQUEST; if (full_table)