Skip to content

Commit 2a789fc

Browse files
Geliang Tanggregkh
authored andcommitted
selftests/bpf: Close fd in error path in drop_on_reuseport
[ Upstream commit adae187 ] In the error path when update_lookup_map() fails in drop_on_reuseport in prog_tests/sk_lookup.c, "server1", the fd of server 1, should be closed. This patch fixes this by using "goto close_srv1" lable instead of "detach" to close "server1" in this case. Fixes: 0ab5539 ("selftests/bpf: Tests for BPF_SK_LOOKUP attach point") Acked-by: Eduard Zingerman <[email protected]> Signed-off-by: Geliang Tang <[email protected]> Link: https://lore.kernel.org/r/86aed33b4b0ea3f04497c757845cff7e8e621a2d.1720515893.git.tanggeliang@kylinos.cn Signed-off-by: Martin KaFai Lau <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
1 parent d179ebe commit 2a789fc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tools/testing/selftests/bpf/prog_tests/sk_lookup.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -994,7 +994,7 @@ static void drop_on_reuseport(const struct test *t)
994994

995995
err = update_lookup_map(t->sock_map, SERVER_A, server1);
996996
if (err)
997-
goto detach;
997+
goto close_srv1;
998998

999999
/* second server on destination address we should never reach */
10001000
server2 = make_server(t->sotype, t->connect_to.ip, t->connect_to.port,

0 commit comments

Comments
 (0)