summaryrefslogtreecommitdiffstats
path: root/tools/testing
diff options
context:
space:
mode:
authorDaniel Borkmann <daniel@iogearbox.net>2017-01-26 00:42:49 +0100
committerDavid S. Miller <davem@davemloft.net>2017-01-25 23:15:28 -0500
commit0901df3aeaee6cb5dde2fd51089786aff6225ebf (patch)
treed55161ddc68c74ec75faa8bfd219a6e593a14c17 /tools/testing
parent1541f98cc252fac55d4e7cc933deddf341ff1710 (diff)
downloadlinux-0901df3aeaee6cb5dde2fd51089786aff6225ebf.tar.gz
linux-0901df3aeaee6cb5dde2fd51089786aff6225ebf.tar.bz2
linux-0901df3aeaee6cb5dde2fd51089786aff6225ebf.zip
bpf: use prefix_len in test_tag when reading fdinfo
We currently used len instead of prefix_len for the strncmp() in fdinfo on the prog_tag. It still worked as we matched on the correct output line also with first 8 instead of 10 chars, but lets fix it properly to use the intended length. Fixes: 62b64660262a ("bpf: add prog tag test case to bpf selftests") Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Acked-by: Alexei Starovoitov <ast@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'tools/testing')
-rw-r--r--tools/testing/selftests/bpf/test_tag.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/testing/selftests/bpf/test_tag.c b/tools/testing/selftests/bpf/test_tag.c
index 6ab4793b3d16..5f7c602f47d1 100644
--- a/tools/testing/selftests/bpf/test_tag.c
+++ b/tools/testing/selftests/bpf/test_tag.c
@@ -99,7 +99,7 @@ static void tag_from_fdinfo(int fd_prog, uint8_t *tag, uint32_t len)
assert(fp);
while (fgets(buff, sizeof(buff), fp)) {
- if (strncmp(buff, "prog_tag:\t", len))
+ if (strncmp(buff, "prog_tag:\t", prefix_len))
continue;
ret = hex2bin(tag, buff + prefix_len, len);
break;