selftests/tcp_ao: Zero-init tcp_ao_info_opt
BugLink: https://bugs.launchpad.net/bugs/2068087
[ Upstream commit b089b3bead532419cdcbd8e4e0a3e23c49d11573 ]
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: b26660531c ("selftests/net: Add test for TCP-AO add setsockopt() command")
Signed-off-by: Dmitry Safonov <0x7f454c46@gmail.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Portia Stephens <portia.stephens@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
This commit is contained in:
committed by
Stefan Bader
parent
41739f47dc
commit
7a6ae6486b
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user