]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
tls: Avoid -Wflex-array-member-not-at-end warning
authorGustavo A. R. Silva <gustavoars@kernel.org>
Tue, 23 Sep 2025 20:45:10 +0000 (22:45 +0200)
committerJakub Kicinski <kuba@kernel.org>
Wed, 24 Sep 2025 23:23:02 +0000 (16:23 -0700)
Remove unused flexible-array member in struct tls_rec and, with this,
fix the following warning:

net/tls/tls.h:131:29: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end]

Also, add a comment to prevent people from adding any members
after struct aead_request, which is a flexible structure --this is
a structure that ends in a flexible-array member.

Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Reviewed-by: Sabrina Dubroca <sd@queasysnail.net>
Link: https://patch.msgid.link/aNMG1lyXw4XEAVaE@kspp
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/tls/tls.h

index e4c42731ce39aea75c51b9fe06cc45b2e52f4a0e..2f86baeb71fcb9edadc29b4b1653141f7d541cdc 100644 (file)
@@ -128,8 +128,9 @@ struct tls_rec {
 
        char aad_space[TLS_AAD_SPACE_SIZE];
        u8 iv_data[TLS_MAX_IV_SIZE];
+
+       /* Must be last --ends in a flexible-array member. */
        struct aead_request aead_req;
-       u8 aead_req_ctx[];
 };
 
 int __net_init tls_proc_init(struct net *net);