Skip to content

Commit

Permalink
selftests/tcp_ao: Zero-init tcp_ao_info_opt
Browse files Browse the repository at this point in the history
The structure is on the stack and has to be zero-initialized as
the kernel checks for:
>	if (in.reserved != 0 || in.reserved2 != 0)
>		return -EINVAL;

Fixes: b266605 ("selftests/net: Add test for TCP-AO add setsockopt() command")
Signed-off-by: Dmitry Safonov <[email protected]>
Signed-off-by: Paolo Abeni <[email protected]>
  • Loading branch information
0x7f454c46 authored and Paolo Abeni committed Apr 16, 2024
1 parent 4225dfa commit b089b3b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tools/testing/selftests/net/tcp_ao/setsockopt-closed.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ static void make_listen(int sk)
static void test_vefify_ao_info(int sk, struct tcp_ao_info_opt *info,
const char *tst)
{
struct tcp_ao_info_opt tmp;
struct tcp_ao_info_opt tmp = {};
socklen_t len = sizeof(tmp);

if (getsockopt(sk, IPPROTO_TCP, TCP_AO_INFO, &tmp, &len))
Expand Down

0 comments on commit b089b3b

Please sign in to comment.