selftest/bpf: Use bpf_sk_lookup_{tcp, udp} in test_sock_addr
authorAndrey Ignatov <rdna@fb.com>
Fri, 9 Nov 2018 18:54:02 +0000 (10:54 -0800)
committerAlexei Starovoitov <ast@kernel.org>
Sat, 17 Nov 2018 01:54:29 +0000 (17:54 -0800)
commit9108e3a023d3e4e77d94b589b07d397b0a790285
tree22cd3a19d8d16ade62ed4be8ec0bd5c1b723f723
parent6c49e65e0d462963b4fac97ebd87014342167027
selftest/bpf: Use bpf_sk_lookup_{tcp, udp} in test_sock_addr

Use bpf_sk_lookup_tcp, bpf_sk_lookup_udp and bpf_sk_release helpers from
test_sock_addr programs to make sure they're available and can lookup
and release socket properly for IPv4/IPv4, TCP/UDP.

Reading from a few fields of returned struct bpf_sock is also tested.

Signed-off-by: Andrey Ignatov <rdna@fb.com>
Acked-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Martin KaFai Lau <kafai@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
tools/testing/selftests/bpf/connect4_prog.c
tools/testing/selftests/bpf/connect6_prog.c