1
0
Fork 0
mirror of synced 2025-03-06 20:59:54 +01:00
linux/tools/testing/selftests/net/mptcp
John Hubbard eb709b5f65 selftests/net: fix uninitialized variables
When building with clang, via:

    make LLVM=1 -C tools/testing/selftest

...clang warns about three variables that are not initialized in all
cases:

1) The opt_ipproto_off variable is used uninitialized if "testname" is
not "ip". Willem de Bruijn pointed out that this is an actual bug, and
suggested the fix that I'm using here (thanks!).

2) The addr_len is used uninitialized, but only in the assert case,
   which bails out, so this is harmless.

3) The family variable in add_listener() is only used uninitialized in
   the error case (neither IPv4 nor IPv6 is specified), so it's also
   harmless.

Fix by initializing each variable.

Signed-off-by: John Hubbard <jhubbard@nvidia.com>
Reviewed-by: Willem de Bruijn <willemb@google.com>
Acked-by: Mat Martineau <martineau@kernel.org>
Link: https://lore.kernel.org/r/20240506190204.28497-1-jhubbard@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2024-05-07 17:22:18 -07:00
..
.gitignore selftests: mptcp: add inq test case 2021-12-07 11:36:30 -08:00
config selftests: mptcp: add missing kconfig for NF Mangle 2024-02-01 09:06:37 -08:00
diag.sh selftests: mptcp: test last time mptcp_info 2024-04-11 08:19:54 -07:00
Makefile selftests: mptcp: connect: skip if MPTCP is not supported 2023-05-30 13:21:02 +02:00
mptcp_connect.c selftests/net: mptcp: fix uninitialized variable warnings 2023-11-27 18:12:07 -08:00
mptcp_connect.sh selftests: mptcp: add tc check for check_tools 2024-04-08 11:53:20 +01:00
mptcp_inq.c selftests/net: mptcp: fix uninitialized variable warnings 2023-11-27 18:12:07 -08:00
mptcp_join.sh selftests: mptcp: export pm_nl endpoint ops 2024-04-08 11:53:21 +01:00
mptcp_lib.sh selftests: mptcp: export pm_nl endpoint ops 2024-04-08 11:53:21 +01:00
mptcp_sockopt.c selftests: mptcp: add MPTCP_FULL_INFO testcase 2023-06-21 22:45:58 -07:00
mptcp_sockopt.sh selftests: mptcp: ip_mptcp option for more scripts 2024-04-08 11:53:21 +01:00
pm_netlink.sh selftests: mptcp: netlink: drop disable=SC2086 2024-04-08 11:53:21 +01:00
pm_nl_ctl.c selftests/net: fix uninitialized variables 2024-05-07 17:22:18 -07:00
settings selftests: mptcp: increase timeout to 30 min 2024-02-01 09:06:37 -08:00
simult_flows.sh selftests: mptcp: ip_mptcp option for more scripts 2024-04-08 11:53:21 +01:00
userspace_pm.sh selftests: mptcp: use KSFT_SKIP/KSFT_PASS/KSFT_FAIL 2024-03-11 15:07:27 -07:00