Repository : ssh://git@open-mesh.org/batctl
On branch : next
commit fc04a7815b2ad676bcfcceeba2adea5c53dfd5a6 Author: Martin Hundebøll martin@hundeboll.net Date: Thu Mar 14 21:30:21 2013 +0100
batctl: Fix endianness errors for network coding
Add a htonl() in network_coding.c when reading the sequence number from received ogm_packet, to avoid wrong byte ordering when comparing with a host value. This bug was introduced in 3ed7ada3f0bbcd058567bc0a8f9729a73eba7db6 ("batman-adv: network coding - detect coding nodes and remove these after timeout").
Change the type of coded_packet->coded_len from uint16 to __be16 to avoid wrong assumptions about endianness in later uses. Introduced in c3289f3650d34b60296000a629c99f2488f7c3dd ("batman-adv: network coding - code and transmit packets if possible").
Reported-by: Fengguang Wu fengguang.wu@intel.com Signed-off-by: Martin Hundebøll martin@hundeboll.net Signed-off-by: Marek Lindner lindner_marek@yahoo.de
fc04a7815b2ad676bcfcceeba2adea5c53dfd5a6 packet.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/packet.h b/packet.h index a079958..a51ccfc 100644 --- a/packet.h +++ b/packet.h @@ -308,7 +308,7 @@ struct batadv_coded_packet { uint8_t second_source[ETH_ALEN]; uint8_t second_orig_dest[ETH_ALEN]; __be32 second_crc; - uint16_t coded_len; + __be16 coded_len; };
#endif /* _NET_BATMAN_ADV_PACKET_H_ */