]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUILD: connection: fix build on clang after the VAR_ARRAY cleanup
authorWilly Tarreau <w@1wt.eu>
Mon, 14 Sep 2020 06:43:51 +0000 (08:43 +0200)
committerWilly Tarreau <w@1wt.eu>
Mon, 14 Sep 2020 06:43:51 +0000 (08:43 +0200)
Commit 4987a4744 ("CLEANUP: tree-wide: use VAR_ARRAY instead of [0] in
various definitions") broke the build on clang due to the tlv field used
to receive/send the proxy protocol. The problem is that struct tlv is
included at the beginning of struct tlv_ssl, which doesn't make much
sense. In fact the value[] array isn't really a var array but just an
end of struct marker, and must really be an array of size zero.

include/haproxy/connection-t.h

index 3aab5d05ef35b9dd7f02840a969db41a81406f13..9caa2ca49911b53b06e0c0bfd13df9fc7c8ca2aa 100644 (file)
@@ -589,7 +589,7 @@ struct tlv {
        uint8_t type;
        uint8_t length_hi;
        uint8_t length_lo;
-       uint8_t value[VAR_ARRAY];
+       uint8_t value[0];
 }__attribute__((packed));
 
 struct tlv_ssl {