]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
DOC: proxy-proto: underline the packed attribute for struct pp2_tlv_ssl
authorWilly Tarreau <w@1wt.eu>
Wed, 11 Feb 2026 13:46:55 +0000 (14:46 +0100)
committerWilly Tarreau <w@1wt.eu>
Wed, 11 Feb 2026 13:46:55 +0000 (14:46 +0100)
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.

doc/proxy-protocol.txt

index 2c5cfae9633e450b0e3412f8ebe746b0c8cd5bd5..18d7031d5ab93292d931f568f1a574fab7b0e153 100644 (file)
@@ -627,7 +627,10 @@ For the type PP2_TYPE_SSL, the value is itself a defined like this :
                 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.