diff options
| author | Felix Fietkau | 2021-11-21 12:43:41 +0000 |
|---|---|---|
| committer | Felix Fietkau | 2021-11-21 12:43:45 +0000 |
| commit | 2743e58741b304c37858dbc44435a164215b0a87 (patch) | |
| tree | 8cca43a290a610f20a7024687153981180b3540b | |
| parent | e728a319a9a5ac692d18fef936e6ac4377f1bbf1 (diff) | |
| download | qosify-2743e58741b304c37858dbc44435a164215b0a87.tar.gz | |
bpf: work around a verifier issue
Force access to both src/dest fields, otherwise the llvm optimizer can turn
this into pointer arithmetic that older kernels will reject
Signed-off-by: Felix Fietkau <nbd@nbd.name>
| -rw-r--r-- | qosify-bpf.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/qosify-bpf.c b/qosify-bpf.c index eb13e9b..a0635ec 100644 --- a/qosify-bpf.c +++ b/qosify-bpf.c @@ -258,10 +258,12 @@ parse_l4proto(struct qosify_config *config, struct __sk_buff *skb, return; } + src = READ_ONCE(udp->source); + dest = READ_ONCE(udp->dest); if (ingress) - key = udp->source; + key = src; else - key = udp->dest; + key = dest; if (proto == IPPROTO_TCP) { value = bpf_map_lookup_elem(&tcp_ports, &key); |