On Saturday 28 May 2011 13:45:29 Marek Lindner wrote:
@@ -99,16 +100,19 @@ struct icmp_packet_rr { struct unicast_packet { uint8_t packet_type; uint8_t version; /* batman version field */
- uint8_t dest[6]; uint8_t ttl;
- uint8_t reserved;
- uint8_t dest[6];
} __packed;
struct unicast_frag_packet { uint8_t packet_type; uint8_t version; /* batman version field */
- uint8_t dest[6]; uint8_t ttl;
- uint8_t reserved;
- uint8_t dest[6]; uint8_t flags;
- uint8_t align; uint8_t orig[6]; uint16_t seqno;
} __packed;
Why dont you use the reserverd part for the flags which are currently not in unicast? Then you could also remove that other align byte. It would still be possible to add flags to unicast packets when necessary.
@@ -116,18 +120,20 @@ struct unicast_frag_packet { struct bcast_packet { uint8_t packet_type; uint8_t version; /* batman version field */
- uint8_t orig[6]; uint8_t ttl;
- uint8_t reserved;
- uint8_t orig[6]; uint32_t seqno;
} __packed;
Wouldn't that lead to an unaligned seqno?
Kind regards, Sven