Skip to content

Commit

Permalink
selftests/bpf: Fix bpf-iter-tcp4 test to print correctly the dest IP
Browse files Browse the repository at this point in the history
[ Upstream commit 277b134 ]

Currently, this test is incorrectly printing the destination port in
place of the destination IP.

Fixes: 2767c97 ("selftests/bpf: Implement sample tcp/tcp6 bpf_iter programs")
Signed-off-by: Jose Blanquicet <josebl@microsoft.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Yonghong Song <yhs@fb.com>
Link: https://lore.kernel.org/bpf/20210805164044.527903-1-josebl@microsoft.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
blanquicet authored and gregkh committed Sep 15, 2021
1 parent d6337df commit 416929e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tools/testing/selftests/bpf/progs/bpf_iter_tcp4.c
Expand Up @@ -122,7 +122,7 @@ static int dump_tcp_sock(struct seq_file *seq, struct tcp_sock *tp,
}

BPF_SEQ_PRINTF(seq, "%4d: %08X:%04X %08X:%04X ",
seq_num, src, srcp, destp, destp);
seq_num, src, srcp, dest, destp);
BPF_SEQ_PRINTF(seq, "%02X %08X:%08X %02X:%08lX %08X %5u %8d %lu %d ",
state,
tp->write_seq - tp->snd_una, rx_queue,
Expand Down

0 comments on commit 416929e

Please sign in to comment.