From patchwork Wed Apr 18 18:10:58 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Al Viro X-Patchwork-Id: 1734 Return-Path: Received: from ZenIV.linux.org.uk (zeniv.linux.org.uk [195.92.253.2]) by open-mesh.org (Postfix) with ESMTPS id 3E8F06007C9 for ; Wed, 18 Apr 2012 20:11:00 +0200 (CEST) Received: from viro by ZenIV.linux.org.uk with local (Exim 4.76 #1 (Red Hat Linux)) id 1SKZLG-0006UA-8G; Wed, 18 Apr 2012 18:10:58 +0000 Date: Wed, 18 Apr 2012 19:10:58 +0100 From: Al Viro To: Antonio Quartulli Message-ID: <20120418181058.GD6589@ZenIV.linux.org.uk> References: <1334743210-12338-1-git-send-email-ordex@autistici.org> <20120418180837.GB6589@ZenIV.linux.org.uk> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20120418180837.GB6589@ZenIV.linux.org.uk> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: Al Viro Cc: netdev@vger.kernel.org, b.a.t.m.a.n@lists.open-mesh.org, davem@davemloft.net Subject: [B.A.T.M.A.N.] [PATCH 2/4] batman: don't bother flipping ->tt_crc 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 18:11:00 -0000 Again, keep ->tt_crc in batman_ogv_packet net-endian Signed-off-by: Al Viro --- net/batman-adv/bat_iv_ogm.c | 6 ++---- net/batman-adv/packet.h | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/net/batman-adv/bat_iv_ogm.c b/net/batman-adv/bat_iv_ogm.c index ab2085c..5aa8861 100644 --- a/net/batman-adv/bat_iv_ogm.c +++ b/net/batman-adv/bat_iv_ogm.c @@ -544,7 +544,6 @@ static void bat_iv_ogm_forward(struct orig_node *orig_node, batman_ogm_packet->tq, batman_ogm_packet->header.ttl); batman_ogm_packet->seqno = htonl(batman_ogm_packet->seqno); - batman_ogm_packet->tt_crc = htons(batman_ogm_packet->tt_crc); /* switch of primaries first hop flag when forwarding */ batman_ogm_packet->flags &= ~PRIMARIES_FIRST_HOP; @@ -722,7 +721,7 @@ update_tt: tt_update_orig(bat_priv, orig_node, tt_buff, batman_ogm_packet->tt_num_changes, batman_ogm_packet->ttvn, - batman_ogm_packet->tt_crc); + ntohs(batman_ogm_packet->tt_crc)); if (orig_node->gw_flags != batman_ogm_packet->gw_flags) gw_node_update(bat_priv, orig_node, @@ -969,7 +968,7 @@ static void bat_iv_ogm_process(const struct ethhdr *ethhdr, ethhdr->h_source, if_incoming->net_dev->name, if_incoming->net_dev->dev_addr, batman_ogm_packet->orig, batman_ogm_packet->prev_sender, batman_ogm_packet->seqno, - batman_ogm_packet->ttvn, batman_ogm_packet->tt_crc, + batman_ogm_packet->ttvn, ntohs(batman_ogm_packet->tt_crc), batman_ogm_packet->tt_num_changes, batman_ogm_packet->tq, batman_ogm_packet->header.ttl, batman_ogm_packet->header.version, has_directlink_flag); @@ -1214,7 +1213,6 @@ static int bat_iv_ogm_receive(struct sk_buff *skb, /* network to host order for our 32bit seqno and the orig_interval */ batman_ogm_packet->seqno = ntohl(batman_ogm_packet->seqno); - batman_ogm_packet->tt_crc = ntohs(batman_ogm_packet->tt_crc); tt_buff = packet_buff + buff_pos + BATMAN_OGM_HLEN; diff --git a/net/batman-adv/packet.h b/net/batman-adv/packet.h index 9157f7c..61a7fe0 100644 --- a/net/batman-adv/packet.h +++ b/net/batman-adv/packet.h @@ -132,7 +132,7 @@ struct batman_ogm_packet { uint8_t tq; uint8_t tt_num_changes; uint8_t ttvn; /* translation table version number */ - uint16_t tt_crc; + __be16 tt_crc; } __packed; #define BATMAN_OGM_HLEN sizeof(struct batman_ogm_packet)