diff options
| author | Felix Fietkau | 2022-01-26 14:02:17 +0000 |
|---|---|---|
| committer | Felix Fietkau | 2022-02-10 20:03:39 +0000 |
| commit | 580d2ccf89f3431efefaec5d2dd58522f6e6d2e3 (patch) | |
| tree | b7f2c89943183335dec2d7d867517fad06fecf25 | |
| parent | e230e71e0a12e77bd000fae577dc94a9af602cce (diff) | |
| download | qosify-580d2ccf89f3431efefaec5d2dd58522f6e6d2e3.tar.gz | |
bpf: declare tcp_ports/udp_ports without typedef
Improve compatibility with different versions of LLVM
Signed-off-by: Felix Fietkau <nbd@nbd.name>
| -rw-r--r-- | qosify-bpf.c | 15 |
1 files 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); |