]> git.baikalelectronics.ru Git - kernel.git/commit
samples/bpf: fix a compilation failure
authorYonghong Song <yhs@fb.com>
Tue, 18 Sep 2018 05:08:13 +0000 (22:08 -0700)
committerDaniel Borkmann <daniel@iogearbox.net>
Tue, 18 Sep 2018 15:50:02 +0000 (17:50 +0200)
commit926cf4e83ef2abb6e05881e88ef57d61197db336
treee709fd48192d0af107dc4a477e9fc3e963728877
parent6c3de62fa3056be075e9b9c0585cce9322a466fd
samples/bpf: fix a compilation failure

samples/bpf build failed with the following errors:

  $ make samples/bpf/
  ...
  HOSTCC  samples/bpf/sockex3_user.o
  /data/users/yhs/work/net-next/samples/bpf/sockex3_user.c:16:8: error: redefinition of ‘struct bpf_flow_keys’
   struct bpf_flow_keys {
          ^
  In file included from /data/users/yhs/work/net-next/samples/bpf/sockex3_user.c:4:0:
  ./usr/include/linux/bpf.h:2338:9: note: originally defined here
    struct bpf_flow_keys *flow_keys;
           ^
  make[3]: *** [samples/bpf/sockex3_user.o] Error 1

Commit 23513a9014456 ("flow_dissector: implements flow dissector BPF hook")
introduced struct bpf_flow_keys in include/uapi/linux/bpf.h and hence
caused the naming conflict with samples/bpf/sockex3_user.c.

The fix is to rename struct bpf_flow_keys in samples/bpf/sockex3_user.c
to flow_keys to avoid the conflict.

Signed-off-by: Yonghong Song <yhs@fb.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
samples/bpf/sockex3_user.c