summaryrefslogtreecommitdiffstats
path: root/samples/bpf/sockex2_kern.c
diff options
context:
space:
mode:
Diffstat (limited to 'samples/bpf/sockex2_kern.c')
-rw-r--r--samples/bpf/sockex2_kern.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/samples/bpf/sockex2_kern.c b/samples/bpf/sockex2_kern.c
index 5566fa7d92fa..a7bcd03bf529 100644
--- a/samples/bpf/sockex2_kern.c
+++ b/samples/bpf/sockex2_kern.c
@@ -190,12 +190,12 @@ struct pair {
long bytes;
};
-struct bpf_map_def SEC("maps") hash_map = {
- .type = BPF_MAP_TYPE_HASH,
- .key_size = sizeof(__be32),
- .value_size = sizeof(struct pair),
- .max_entries = 1024,
-};
+struct {
+ __uint(type, BPF_MAP_TYPE_HASH);
+ __type(key, __be32);
+ __type(value, struct pair);
+ __uint(max_entries, 1024);
+} hash_map SEC(".maps");
SEC("socket2")
int bpf_prog2(struct __sk_buff *skb)