From patchwork Sat Apr 14 11:15:27 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Antonio Quartulli X-Patchwork-Id: 1692 Return-Path: Received: from latitanza.investici.org (latitanza.investici.org [82.94.249.234]) by open-mesh.org (Postfix) with ESMTPS id 2804960073D for ; Sat, 14 Apr 2012 13:14:38 +0200 (CEST) Authentication-Results: open-mesh.org; dkim=pass (1024-bit key) header.i=@autistici.org; dkim-adsp=pass Received: from [82.94.249.234] (latitanza [82.94.249.234]) (Authenticated sender: ordex@autistici.org) by localhost (Postfix) with ESMTPSA id 656D6985E7; Sat, 14 Apr 2012 11:14:37 +0000 (UTC) X-DKIM: Sendmail DKIM Filter v2.8.2 latitanza.investici.org 656D6985E7 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=autistici.org; s=stigmate; t=1334402077; bh=1n2VH0XcW2uDItduOq4w21riDATQP9bqs6y4P+ZT4vs=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References; b=tMsW/RqnPsTne3wvAm1ghOvwFWEx60CO7knk1/W8NUAaBwYsKjNsKjvOE22atYu+5 8hufEnqkOtp+uzECVvi+hkS+qgabX1P1Xniz3/d69lN7Wjltbj+N/2bA+9Cwp9mYP5 Q9P6CQD+kbhNRlzf43DZZGsjQAAikxW2vRzfxq5g= From: Antonio Quartulli To: b.a.t.m.a.n@lists.open-mesh.org Date: Sat, 14 Apr 2012 13:15:27 +0200 Message-Id: <1334402127-5211-3-git-send-email-ordex@autistici.org> X-Mailer: git-send-email 1.7.9.4 In-Reply-To: <1334402127-5211-1-git-send-email-ordex@autistici.org> References: <1334402127-5211-1-git-send-email-ordex@autistici.org> Subject: [B.A.T.M.A.N.] [PATCH 2/2] 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: Sat, 14 Apr 2012 11:14:38 -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 --- translation-table.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/translation-table.c b/translation-table.c index 72dfbe1..88e4c8e 100644 --- a/translation-table.c +++ b/translation-table.c @@ -1341,7 +1341,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)