Oto Valek rightfully reported in issue #3262 that the proxy-protocol
doc makes no mention of the packed attribute on struct pp2_tlv_ssl,
which is mandatory since fields are not type-aligned in it. Let's
add it in the definition and make an explicit mention about it to
save implementers from wasting their time trying to debug this.
It can be backported.
uint8_t client;
uint32_t verify;
struct pp2_tlv sub_tlv[0];
- };
+ } __attribute__((packed));
+
+Note the "packed" attribute which indicates that each field starts immediately
+after the previous one (i.e. without type-specific alignment nor padding).
The <verify> field will be zero if the client presented a certificate
and it was successfully verified, and non-zero otherwise.