mirror of
https://github.com/torvalds/linux.git
synced 2026-06-04 20:46:48 +02:00
selftests/bpf: Drop duplicate definition of i in test_sockmap
There's already a definition of i in run_options() at the beginning, no need to define a new one in "if (tx_prog_fd > 0)" block. Signed-off-by: Geliang Tang <tanggeliang@kylinos.cn> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Tested-by: Jakub Sitnicki <jakub@cloudflare.com> Acked-by: John Fastabend <john.fastabend@gmail.com> Link: https://lore.kernel.org/bpf/8d690682330a59361562bca75d6903253d16f312.1716446893.git.tanggeliang@kylinos.cn
This commit is contained in:
parent
d95ba15b97
commit
a9f0ea1759
|
|
@ -1030,7 +1030,7 @@ static int run_options(struct sockmap_options *options, int cg_fd, int test)
|
|||
tx_prog_fd = -1;
|
||||
|
||||
if (tx_prog_fd > 0) {
|
||||
int redir_fd, i = 0;
|
||||
int redir_fd;
|
||||
|
||||
err = bpf_prog_attach(tx_prog_fd,
|
||||
map_fd[1], BPF_SK_MSG_VERDICT, 0);
|
||||
|
|
@ -1041,6 +1041,7 @@ static int run_options(struct sockmap_options *options, int cg_fd, int test)
|
|||
goto out;
|
||||
}
|
||||
|
||||
i = 0;
|
||||
err = bpf_map_update_elem(map_fd[1], &i, &c1, BPF_ANY);
|
||||
if (err) {
|
||||
fprintf(stderr,
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user