Commit 37a6a9e7 authored by Andrii Nakryiko's avatar Andrii Nakryiko Committed by Daniel Borkmann
Browse files

selftests/bpf: Fix two minor compilation warnings reported by GCC 4.9



GCC 4.9 seems to be more strict in some regards. Fix two minor issue it
reported.

Fixes: 1c1052e0 ("tools/testing/selftests/bpf: Add self-tests for new helper bpf_get_ns_current_pid_tgid.")
Fixes: 2d7824ff ("selftests: bpf: Add test for sk_assign")
Signed-off-by: default avatarAndrii Nakryiko <andriin@fb.com>
Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
Acked-by: default avatarYonghong Song <yhs@fb.com>
Link: https://lore.kernel.org/bpf/20200820061411.1755905-3-andriin@fb.com
parent dda1ec9f
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -268,6 +268,7 @@ void test_sk_assign(void)
	int server = -1;
	int server_map;
	int self_net;
	int i;

	self_net = open(NS_SELF, O_RDONLY);
	if (CHECK_FAIL(self_net < 0)) {
@@ -286,7 +287,7 @@ void test_sk_assign(void)
		goto cleanup;
	}

	for (int i = 0; i < ARRAY_SIZE(tests) && !READ_ONCE(stop); i++) {
	for (i = 0; i < ARRAY_SIZE(tests) && !READ_ONCE(stop); i++) {
		struct test_sk_cfg *test = &tests[i];
		const struct sockaddr *addr;
		const int zero = 0;
+1 −0
Original line number Diff line number Diff line
@@ -156,4 +156,5 @@ cleanup:
			bpf_object__close(obj);
		}
	}
	return 0;
}