]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commit
selftests/bpf: fix broken build of test_maps
authorAlexei Starovoitov <ast@fb.com>
Sun, 22 Oct 2017 17:29:06 +0000 (10:29 -0700)
committerDavid S. Miller <davem@davemloft.net>
Mon, 23 Oct 2017 00:06:31 +0000 (01:06 +0100)
commite27afb84b4680570b64c958dfcba9e0b3da92fc9
tree9ca8f99bbd1c4019508481b20844dddea9c47034
parentf8ddadc4db6c7b7029b6d0e0d9af24f74ad27ca2
selftests/bpf: fix broken build of test_maps

fix multiple build errors and warnings

1.
test_maps.c: In function ‘test_map_rdonly’:
test_maps.c:1051:30: error: ‘BPF_F_RDONLY’ undeclared (first use in this function)
        MAP_SIZE, map_flags | BPF_F_RDONLY);

2.
test_maps.c:1048:6: warning: unused variable ‘i’ [-Wunused-variable]
  int i, fd, key = 0, value = 0;

3.
test_maps.c:1087:2: error: called object is not a function or function pointer
  assert(bpf_map_lookup_elem(fd, &key, &value) == -1 && errno == EPERM);

4.
./bpf_helpers.h:72:11: error: use of undeclared identifier 'BPF_FUNC_getsockopt'
        (void *) BPF_FUNC_getsockopt;

Fixes: e043325b3087 ("bpf: Add tests for eBPF file mode")
Fixes: 6e71b04a8224 ("bpf: Add file mode configuration into bpf maps")
Fixes: cd86d1fd2102 ("bpf: Adding helper function bpf_getsockops")
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
tools/include/uapi/linux/bpf.h
tools/testing/selftests/bpf/test_maps.c