diff options
author | Stanislav Fomichev <sdf@google.com> | 2019-12-13 14:30:28 -0800 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2019-12-13 15:26:53 -0800 |
commit | a06bf42f5a95ff462401d59d0c08cf4620213647 (patch) | |
tree | d36902bf1ad4a97c511b6b5ae6a383341824291e /tools/testing/selftests/bpf/progs/test_skb_ctx.c | |
parent | 850a88cc4096fe1df407452ba2e4d28cf5b3eee9 (diff) |
selftests/bpf: Test wire_len/gso_segs in BPF_PROG_TEST_RUN
Make sure we can pass arbitrary data in wire_len/gso_segs.
Signed-off-by: Stanislav Fomichev <sdf@google.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Martin KaFai Lau <kafai@fb.com>
Link: https://lore.kernel.org/bpf/20191213223028.161282-2-sdf@google.com
Diffstat (limited to 'tools/testing/selftests/bpf/progs/test_skb_ctx.c')
-rw-r--r-- | tools/testing/selftests/bpf/progs/test_skb_ctx.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tools/testing/selftests/bpf/progs/test_skb_ctx.c b/tools/testing/selftests/bpf/progs/test_skb_ctx.c index 2a9f4c736ebc..534fbf9a7344 100644 --- a/tools/testing/selftests/bpf/progs/test_skb_ctx.c +++ b/tools/testing/selftests/bpf/progs/test_skb_ctx.c @@ -18,5 +18,10 @@ int process(struct __sk_buff *skb) skb->priority++; skb->tstamp++; + if (skb->wire_len != 100) + return 1; + if (skb->gso_segs != 8) + return 1; + return 0; } |