selftests/bpf: fix compilation error for flow_dissector.c
authorAlan Maguire <alan.maguire@oracle.com>
Wed, 29 May 2019 09:48:14 +0000 (10:48 +0100)
committerDaniel Borkmann <daniel@iogearbox.net>
Wed, 29 May 2019 13:15:07 +0000 (15:15 +0200)
commitfe937ea12ec83da6c6bbbdb54a03062155318d0e
tree0f7ccd4a9bb2943afdc160d63f28b1c61b85fdf4
parentd0a3a4b2189904955b6b52c06f986b5e021811a7
selftests/bpf: fix compilation error for flow_dissector.c

When building the tools/testing/selftest/bpf subdirectory,
(running both a local directory "make" and a
"make -C tools/testing/selftests/bpf") I keep hitting the
following compilation error:

prog_tests/flow_dissector.c: In function ‘create_tap’:
prog_tests/flow_dissector.c:150:38: error: ‘IFF_NAPI’ undeclared (first
use in this function)
   .ifr_flags = IFF_TAP | IFF_NO_PI | IFF_NAPI | IFF_NAPI_FRAGS,
                                      ^
prog_tests/flow_dissector.c:150:38: note: each undeclared identifier is
reported only once for each function it appears in
prog_tests/flow_dissector.c:150:49: error: ‘IFF_NAPI_FRAGS’ undeclared

Adding include/uapi/linux/if_tun.h to tools/include/uapi/linux
resolves the problem and ensures the compilation of the file
does not depend on having up-to-date kernel headers locally.

Signed-off-by: Alan Maguire <alan.maguire@oracle.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
tools/include/uapi/linux/if_tun.h [new file with mode: 0644]