Skip to content

Commit b089b3b

Browse files
0x7f454c46Paolo Abeni
authored and
Paolo Abeni
committed
selftests/tcp_ao: Zero-init tcp_ao_info_opt
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]>
1 parent 4225dfa commit b089b3b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tools/testing/selftests/net/tcp_ao/setsockopt-closed.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ static void make_listen(int sk)
2121
static void test_vefify_ao_info(int sk, struct tcp_ao_info_opt *info,
2222
const char *tst)
2323
{
24-
struct tcp_ao_info_opt tmp;
24+
struct tcp_ao_info_opt tmp = {};
2525
socklen_t len = sizeof(tmp);
2626

2727
if (getsockopt(sk, IPPROTO_TCP, TCP_AO_INFO, &tmp, &len))

0 commit comments

Comments
 (0)