From 580d2ccf89f3431efefaec5d2dd58522f6e6d2e3 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Wed, 26 Jan 2022 15:02:17 +0100 Subject: [PATCH] bpf: declare tcp_ports/udp_ports without typedef Improve compatibility with different versions of LLVM Signed-off-by: Felix Fietkau --- qosify-bpf.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/qosify-bpf.c b/qosify-bpf.c index a0635ec..0bddddf 100644 --- a/qosify-bpf.c +++ b/qosify-bpf.c @@ -44,13 +44,21 @@ struct { __uint(max_entries, 1); } config SEC(".maps"); -typedef struct { +struct { __uint(type, BPF_MAP_TYPE_ARRAY); __uint(pinning, 1); __type(key, __u32); __type(value, __u8); __uint(max_entries, 1 << 16); -} port_array_t; +} tcp_ports SEC(".maps"); + +struct { + __uint(type, BPF_MAP_TYPE_ARRAY); + __uint(pinning, 1); + __type(key, __u32); + __type(value, __u8); + __uint(max_entries, 1 << 16); +} udp_ports SEC(".maps"); struct { __uint(type, BPF_MAP_TYPE_LRU_HASH); @@ -60,9 +68,6 @@ struct { __uint(max_entries, QOSIFY_FLOW_BUCKETS); } flow_map SEC(".maps"); -port_array_t tcp_ports SEC(".maps"); -port_array_t udp_ports SEC(".maps"); - struct { __uint(type, BPF_MAP_TYPE_HASH); __uint(pinning, 1); -- 2.30.2