* [PATCH bpf-next] samples/bpf: fix a compilation failure
@ 2018-09-18 5:08 Yonghong Song
2018-09-18 15:51 ` Daniel Borkmann
0 siblings, 1 reply; 2+ messages in thread
From: Yonghong Song @ 2018-09-18 5:08 UTC (permalink / raw)
To: ast, daniel, netdev; +Cc: kernel-team
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 d58e468b1112d ("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>
---
samples/bpf/sockex3_user.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/samples/bpf/sockex3_user.c b/samples/bpf/sockex3_user.c
index 5ba3ae9d180b..22f74d0e1493 100644
--- a/samples/bpf/sockex3_user.c
+++ b/samples/bpf/sockex3_user.c
@@ -13,7 +13,7 @@
#define PARSE_IP_PROG_FD (prog_fd[0])
#define PROG_ARRAY_FD (map_fd[0])
-struct bpf_flow_keys {
+struct flow_keys {
__be32 src;
__be32 dst;
union {
@@ -64,7 +64,7 @@ int main(int argc, char **argv)
(void) f;
for (i = 0; i < 5; i++) {
- struct bpf_flow_keys key = {}, next_key;
+ struct flow_keys key = {}, next_key;
struct pair value;
sleep(1);
--
2.17.1
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH bpf-next] samples/bpf: fix a compilation failure
2018-09-18 5:08 [PATCH bpf-next] samples/bpf: fix a compilation failure Yonghong Song
@ 2018-09-18 15:51 ` Daniel Borkmann
0 siblings, 0 replies; 2+ messages in thread
From: Daniel Borkmann @ 2018-09-18 15:51 UTC (permalink / raw)
To: Yonghong Song, ast, netdev; +Cc: kernel-team
On 09/18/2018 07:08 AM, Yonghong Song wrote:
> 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 d58e468b1112d ("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>
Applied to bpf-next, thanks!
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-09-18 21:24 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-09-18 5:08 [PATCH bpf-next] samples/bpf: fix a compilation failure Yonghong Song
2018-09-18 15:51 ` Daniel Borkmann
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox