Re: [B.A.T.M.A.N.] [PATCH-marek] batman-adv: Unify the first 3 bytes in each packet

Sven Eckelmann
2011-05-28T12:07:10Z

[-- Attachment #1: Type: Text/Plain, Size: 1193 bytes --]

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

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]