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: 153554 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 14ED1B6FD6 for ; Thu, 19 Apr 2012 04:11:03 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752808Ab2DRSLA (ORCPT ); Wed, 18 Apr 2012 14:11:00 -0400 Received: from zeniv.linux.org.uk ([195.92.253.2]:39565 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753097Ab2DRSK7 (ORCPT ); Wed, 18 Apr 2012 14:10:59 -0400 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 Cc: davem@davemloft.net, netdev@vger.kernel.org, b.a.t.m.a.n@lists.open-mesh.org Subject: [PATCH 2/4] batman: don't bother flipping ->tt_crc 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: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org 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)