diff options
author | Xin Long <lucien.xin@gmail.com> | 2023-04-19 18:16:31 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2023-04-21 10:19:30 +0300 |
commit | f97278ff346a5f11c68d0ac499999d5ad06a6db2 (patch) | |
tree | 0764e256eead447868e2f2ce2ce136a8c55f0c48 /net/sctp/sm_make_chunk.c | |
parent | 9789c1c6619e0a5eccfc31abe49b1ce5ca3cd11f (diff) | |
download | linux-f97278ff346a5f11c68d0ac499999d5ad06a6db2.tar.xz |
sctp: delete the nested flexible array peer_init
This patch deletes the flexible-array peer_init[] from the structure
sctp_cookie to avoid some sparse warnings:
# make C=2 CF="-Wflexible-array-nested" M=./net/sctp/
net/sctp/sm_make_chunk.c: note: in included file (through include/net/sctp/sctp.h):
./include/net/sctp/structs.h:1588:28: warning: nested flexible array
./include/net/sctp/structs.h:343:28: warning: nested flexible array
Signed-off-by: Xin Long <lucien.xin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sctp/sm_make_chunk.c')
-rw-r--r-- | net/sctp/sm_make_chunk.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/net/sctp/sm_make_chunk.c b/net/sctp/sm_make_chunk.c index 4dbbbc2a7742..08527d882e56 100644 --- a/net/sctp/sm_make_chunk.c +++ b/net/sctp/sm_make_chunk.c @@ -1707,11 +1707,11 @@ static struct sctp_cookie_param *sctp_pack_cookie( ktime_get_real()); /* Copy the peer's init packet. */ - memcpy(&cookie->c.peer_init[0], init_chunk->chunk_hdr, + memcpy(cookie + 1, init_chunk->chunk_hdr, ntohs(init_chunk->chunk_hdr->length)); /* Copy the raw local address list of the association. */ - memcpy((__u8 *)&cookie->c.peer_init[0] + + memcpy((__u8 *)(cookie + 1) + ntohs(init_chunk->chunk_hdr->length), raw_addrs, addrs_len); if (sctp_sk(ep->base.sk)->hmac) { |