[zeromq-dev] Fix for alignment issue of vsm_data inside zmq_msg_t message type.
john skaller
skaller at users.sourceforge.net
Thu Jan 26 19:24:34 CET 2012
On 27/01/2012, at 4:44 AM, Pieter Hintjens wrote:
> Rick,
>
> Nice work!
>
> Can I assume this affects both 2.1 and 3.1? Could you make a pull
> request on the libzmq repository then? We'll backport to 2-1.
The flags are already at the end in 3.1, it uses this in class msg_t:
union {
struct {
unsigned char unused [max_vsm_size + 1];
unsigned char type;
unsigned char flags;
} base;
struct {
unsigned char data [max_vsm_size];
unsigned char size;
unsigned char type;
unsigned char flags;
} vsm;
struct {
content_t *content;
unsigned char unused [max_vsm_size + 1 - sizeof (content_t*)];
unsigned char type;
unsigned char flags;
} lmsg;
struct {
unsigned char unused [max_vsm_size + 1];
unsigned char type;
unsigned char flags;
} delimiter;
} u;
I remember puzzling over why .. :)
--
john skaller
skaller at users.sourceforge.net
More information about the zeromq-dev
mailing list