selftests/bpf: test_sockmap, fix data verification
authorPrashant Bhole <bhole_prashant_q7@lab.ntt.co.jp>
Thu, 31 May 2018 04:42:39 +0000 (13:42 +0900)
committerDaniel Borkmann <daniel@iogearbox.net>
Sat, 2 Jun 2018 04:13:56 +0000 (06:13 +0200)
commitd825e12f084650649b61209d0cd514c0e57bb0de
tree6244d255ba0540e1c60e9f0aa4ce1e725a08648f
parenta009f1f396d04a700971586ce8a142ea606cbb61
selftests/bpf: test_sockmap, fix data verification

When data verification is enabled, some tests fail because verification is done
incorrectly. Following changes fix it.

- Identify the size of data block to be verified
- Reset verification counter when data block size is reached
- Fixed the value printed in case of verfication failure

Fixes: 16962b2404ac ("bpf: sockmap, add selftests")
Acked-by: John Fastabend <john.fastabend@gmail.com>
Signed-off-by: Prashant Bhole <bhole_prashant_q7@lab.ntt.co.jp>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
tools/testing/selftests/bpf/test_sockmap.c