diff options
author | Al Viro <viro@ZenIV.linux.org.uk> | 2012-04-22 02:45:29 -0400 |
---|---|---|
committer | Antonio Quartulli <ordex@autistici.org> | 2012-06-18 12:01:04 -0400 |
commit | 16a703459bb58aa873c5b36f42093f0f681628af (patch) | |
tree | cedf15e2d0c1a27114dbda6dbfe7c99a57ed37d2 /net/batman-adv | |
parent | f25bd58a9d95481e81a09a3a88c4a3f3ab38609f (diff) |
batman-adv: don't bother flipping ->tt_crc
Keep it net-endian
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Diffstat (limited to 'net/batman-adv')
-rw-r--r-- | net/batman-adv/bat_iv_ogm.c | 10 | ||||
-rw-r--r-- | net/batman-adv/packet.h | 2 |
2 files changed, 3 insertions, 9 deletions
diff --git a/net/batman-adv/bat_iv_ogm.c b/net/batman-adv/bat_iv_ogm.c index 896287e62df9..ec3542c3bf0c 100644 --- a/net/batman-adv/bat_iv_ogm.c +++ b/net/batman-adv/bat_iv_ogm.c | |||
@@ -547,8 +547,6 @@ static void bat_iv_ogm_forward(struct orig_node *orig_node, | |||
547 | "Forwarding packet: tq: %i, ttl: %i\n", | 547 | "Forwarding packet: tq: %i, ttl: %i\n", |
548 | batman_ogm_packet->tq, batman_ogm_packet->header.ttl); | 548 | batman_ogm_packet->tq, batman_ogm_packet->header.ttl); |
549 | 549 | ||
550 | batman_ogm_packet->tt_crc = htons(batman_ogm_packet->tt_crc); | ||
551 | |||
552 | /* switch of primaries first hop flag when forwarding */ | 550 | /* switch of primaries first hop flag when forwarding */ |
553 | batman_ogm_packet->flags &= ~PRIMARIES_FIRST_HOP; | 551 | batman_ogm_packet->flags &= ~PRIMARIES_FIRST_HOP; |
554 | if (is_single_hop_neigh) | 552 | if (is_single_hop_neigh) |
@@ -724,7 +722,7 @@ update_tt: | |||
724 | tt_update_orig(bat_priv, orig_node, tt_buff, | 722 | tt_update_orig(bat_priv, orig_node, tt_buff, |
725 | batman_ogm_packet->tt_num_changes, | 723 | batman_ogm_packet->tt_num_changes, |
726 | batman_ogm_packet->ttvn, | 724 | batman_ogm_packet->ttvn, |
727 | batman_ogm_packet->tt_crc); | 725 | ntohs(batman_ogm_packet->tt_crc)); |
728 | 726 | ||
729 | if (orig_node->gw_flags != batman_ogm_packet->gw_flags) | 727 | if (orig_node->gw_flags != batman_ogm_packet->gw_flags) |
730 | gw_node_update(bat_priv, orig_node, | 728 | gw_node_update(bat_priv, orig_node, |
@@ -972,7 +970,7 @@ static void bat_iv_ogm_process(const struct ethhdr *ethhdr, | |||
972 | ethhdr->h_source, if_incoming->net_dev->name, | 970 | ethhdr->h_source, if_incoming->net_dev->name, |
973 | if_incoming->net_dev->dev_addr, batman_ogm_packet->orig, | 971 | if_incoming->net_dev->dev_addr, batman_ogm_packet->orig, |
974 | batman_ogm_packet->prev_sender, ntohl(batman_ogm_packet->seqno), | 972 | batman_ogm_packet->prev_sender, ntohl(batman_ogm_packet->seqno), |
975 | batman_ogm_packet->ttvn, batman_ogm_packet->tt_crc, | 973 | batman_ogm_packet->ttvn, ntohs(batman_ogm_packet->tt_crc), |
976 | batman_ogm_packet->tt_num_changes, batman_ogm_packet->tq, | 974 | batman_ogm_packet->tt_num_changes, batman_ogm_packet->tq, |
977 | batman_ogm_packet->header.ttl, | 975 | batman_ogm_packet->header.ttl, |
978 | batman_ogm_packet->header.version, has_directlink_flag); | 976 | batman_ogm_packet->header.version, has_directlink_flag); |
@@ -1219,10 +1217,6 @@ static int bat_iv_ogm_receive(struct sk_buff *skb, | |||
1219 | 1217 | ||
1220 | /* unpack the aggregated packets and process them one by one */ | 1218 | /* unpack the aggregated packets and process them one by one */ |
1221 | do { | 1219 | do { |
1222 | /* network to host order for our 32bit seqno and the | ||
1223 | orig_interval */ | ||
1224 | batman_ogm_packet->tt_crc = ntohs(batman_ogm_packet->tt_crc); | ||
1225 | |||
1226 | tt_buff = packet_buff + buff_pos + BATMAN_OGM_HLEN; | 1220 | tt_buff = packet_buff + buff_pos + BATMAN_OGM_HLEN; |
1227 | 1221 | ||
1228 | bat_iv_ogm_process(ethhdr, batman_ogm_packet, | 1222 | bat_iv_ogm_process(ethhdr, batman_ogm_packet, |
diff --git a/net/batman-adv/packet.h b/net/batman-adv/packet.h index 372fc889832a..033d99490e82 100644 --- a/net/batman-adv/packet.h +++ b/net/batman-adv/packet.h | |||
@@ -124,7 +124,7 @@ struct batman_ogm_packet { | |||
124 | uint8_t tq; | 124 | uint8_t tq; |
125 | uint8_t tt_num_changes; | 125 | uint8_t tt_num_changes; |
126 | uint8_t ttvn; /* translation table version number */ | 126 | uint8_t ttvn; /* translation table version number */ |
127 | uint16_t tt_crc; | 127 | __be16 tt_crc; |
128 | } __packed; | 128 | } __packed; |
129 | 129 | ||
130 | #define BATMAN_OGM_HLEN sizeof(struct batman_ogm_packet) | 130 | #define BATMAN_OGM_HLEN sizeof(struct batman_ogm_packet) |