Commit 1589a4f0 authored by Yonghong Song's avatar Yonghong Song

use proper sync for function pointers

This is a correction for previous patch where
function pointer is not proper specified
  static int bpf_map_push_elem(struct bpf_map *map, const void *value, u64 flags) =
     (void *) BPF_FUNC_map_push_elem;
and some old gcc compiler (e.g., ubuntu 16.04) will complain
with error:
  Illegal initializer (only variables can be initialized)
The correct way is
  static int (*bpf_map_push_elem)(struct bpf_map *map, const void *value, u64 flags) =
     (void *) BPF_FUNC_map_push_elem;
Signed-off-by: default avatarYonghong Song <yhs@fb.com>
parent 0e02fec8
......@@ -427,13 +427,13 @@ static struct bpf_sock *(*bpf_sk_lookup_udp)(void *ctx,
(void *) BPF_FUNC_sk_lookup_udp;
static int (*bpf_sk_release)(struct bpf_sock *sk) =
(void *) BPF_FUNC_sk_release;
static int bpf_map_push_elem(struct bpf_map *map, const void *value, u64 flags) =
static int (*bpf_map_push_elem)(void *map, const void *value, u64 flags) =
(void *) BPF_FUNC_map_push_elem;
static int bpf_map_pop_elem(struct bpf_map *map, void *value) =
static int (*bpf_map_pop_elem)(void *map, void *value) =
(void *) BPF_FUNC_map_pop_elem;
static int bpf_map_peek_elem(struct bpf_map *map, void *value) =
static int (*bpf_map_peek_elem)(void *map, void *value) =
(void *) BPF_FUNC_map_peek_elem;
static int bpf_msg_push_data(struct sk_buff *skb, u32 start, u32 len, u64 flags) =
static int (*bpf_msg_push_data)(void *skb, u32 start, u32 len, u64 flags) =
(void *) BPF_FUNC_msg_push_data;
/* llvm builtin functions that eBPF C program may use to
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment