From patchwork Wed Oct 19 12:34:42 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Antonio Quartulli X-Patchwork-Id: 1290 Return-Path: Received: from latitanza.investici.org (latitanza.investici.org [82.94.249.234]) by open-mesh.org (Postfix) with ESMTPS id 60E32600828 for ; Wed, 19 Oct 2011 14:35:40 +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 9708C98369; Wed, 19 Oct 2011 12:35:39 +0000 (UTC) X-DKIM: Sendmail DKIM Filter v2.8.2 latitanza.investici.org 9708C98369 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=autistici.org; s=stigmate; t=1319027739; bh=t5i/Zr8ORv+EA8ebBfaDvBbVqEQUdY/SPme4mSaUufo=; h=From:To:Cc:Subject:Date:Message-Id; b=LaKTyhsdTcFTDqnN3WtQLMzRRG2XDx7l+jb5Va9W047e7o1F8ntqS/oNTPY81hPHy 2IvJF24WM2dzsjOzZBpH/S/MfN8jv2IznOb5NS5kSRfQQD8YbOU60cLA+SJwOZEZw6 d3a7qNcGzgsKZ/nzQk0Bo/1dfTtRfTEhowIE6RDw= From: Antonio Quartull To: b.a.t.m.a.n@lists.open-mesh.org Date: Wed, 19 Oct 2011 14:34:42 +0200 Message-Id: <1319027682-2897-1-git-send-email-ordex@autistici.org> X-Mailer: git-send-email 1.7.3.4 Subject: [B.A.T.M.A.N.] [PATCH] batctl: correct ttcrc print format in the tcpdump output 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, 19 Oct 2011 12:35:40 -0000 The OGM ttcrc field is an unsigned short int, therefore it has to be printed using %hu and has to be converted from network to host order using ntohs Signed-off-by: Antonio Quartull --- tcpdump.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tcpdump.c b/tcpdump.c index 977bedc..7dd289e 100644 --- a/tcpdump.c +++ b/tcpdump.c @@ -331,10 +331,10 @@ static void dump_batman_ogm(unsigned char *packet_buff, ssize_t buff_len, int re printf("BAT %s: ", get_name_by_macaddr((struct ether_addr *)batman_ogm_packet->orig, read_opt)); - printf("OGM via neigh %s, seq %u, tq %3d, ttvn %d, ttcrc %d, ttl %2d, v %d, flags [%c%c%c%c], length %zu\n", + printf("OGM via neigh %s, seq %u, tq %3d, ttvn %d, ttcrc %hu, ttl %2d, v %d, flags [%c%c%c%c], length %zu\n", get_name_by_macaddr((struct ether_addr *)ether_header->ether_shost, read_opt), ntohl(batman_ogm_packet->seqno), batman_ogm_packet->tq, batman_ogm_packet->ttvn, - ntohl(batman_ogm_packet->tt_crc), batman_ogm_packet->ttl, batman_ogm_packet->version, + ntohs(batman_ogm_packet->tt_crc), batman_ogm_packet->ttl, batman_ogm_packet->version, (batman_ogm_packet->flags & DIRECTLINK ? 'D' : '.'), (batman_ogm_packet->flags & VIS_SERVER ? 'V' : '.'), (batman_ogm_packet->flags & PRIMARIES_FIRST_HOP ? 'F' : '.'),