samples/bpf sock_example: Avoid getting ethhdr from two includes
authorArnaldo Carvalho de Melo <acme@redhat.com>
Wed, 28 Dec 2016 00:49:17 +0000 (21:49 -0300)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Wed, 28 Dec 2016 00:49:17 +0000 (21:49 -0300)
commitee12996c9d392ec61241ab6c74d257bc2122e0bc
treeff9548654b82dadabfb1d3aa03d111c6fe9a385b
parent9396c9cb0d9534ca67bda8a34b2413a2ca1c67e9
samples/bpf sock_example: Avoid getting ethhdr from two includes

To avoid the following build failure on Alpine Linux 3.4, that has
clang-3.8 with the bpf target:

    HOSTCC  samples/bpf/sock_example.o
  In file included from /usr/include/net/ethernet.h:10:0,
                   from /git/linux/samples/bpf/sock_example.h:7,
                   from /git/linux/samples/bpf/sock_example.c:30:
  /usr/include/netinet/if_ether.h:96:8: error: redefinition of 'struct
  ethhdr'
   struct ethhdr {
          ^
  In file included from /git/linux/samples/bpf/sock_example.c:26:0:
  ./usr/include/linux/if_ether.h:144:8: note: originally defined here
   struct ethhdr {
          ^
  scripts/Makefile.host:124: recipe for target
  'samples/bpf/sock_example.o' failed
  make[2]: *** [samples/bpf/sock_example.o] Error 1
  /git/linux/Makefile:1658: recipe for target 'samples/bpf/' failed

So include net/if_ether.h for the needs of sock_example.h, using the
same include that sock_example.c uses.

Cc: Alexei Starovoitov <ast@fb.com>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Cc: Joe Stringer <joe@ovn.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/n/tip-m9avekl1b651qe1r1zd5tzz9@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
samples/bpf/sock_example.h