Re: [mpls-linux-general] ldp hello message padding
Status: Beta
Brought to you by:
jleu
|
From: Christophe F. <cf...@ut...> - 2003-07-28 22:14:52
|
On Mon, 28 Jul 2003, a a wrote:
> I.e. when I send a hello message a struct that should be 10 bytes becomes 12
> bytes due to padding to an even word-length...
>
> Eg.
> typedef struct test_s {
> u_short16_t foo; // 2 bytes
> u_short16_t bar; // 2 bytes
> u_short16_t id; // 2 bytes
> u_iint32_t whatever; // 4 bytes
> } test_t;
I think this should work with something like this:
typedef struct test_s {
u_short16_t foo; // 2 bytes
u_short16_t bar; // 2 bytes
u_short16_t id; // 2 bytes
u_iint32_t whatever; // 4 bytes
} __attribute__ ((__packed__)) test_t;
Hope this helps.
|