]> git.ipfire.org Git - thirdparty/pdns.git/commit
Alter the qname bpf filter to make it const. 16452/head
authorMiod Vallat <miod.vallat@powerdns.com>
Fri, 7 Nov 2025 16:56:25 +0000 (17:56 +0100)
committerMiod Vallat <miod.vallat@powerdns.com>
Fri, 7 Nov 2025 18:14:04 +0000 (19:14 +0100)
commit6bef4b8f541ef469acc84cb602268c772700f1ed
treea54477ae402b7eeb9eb35606e917b6eafbca0e79
parent1e44943b9c6f8cc9bd3c78cc8f3dd8aefd50a6e0
Alter the qname bpf filter to make it const.

This program needs to use a runtime value (a file descriptor), so in its
current form it is a non-const HUGE initializer, and causes the compiler
to emit a lot of code to initialize the local variable with the program
data, eating a lot of memory while there.

By changing the program to use a value of zero for the file descriptor,
the initializer becomes const; we need however to search for that
instruction and pach it before using the program, and this is not the
code I am most proud of... but when life gives you lemons, etc.

Signed-off-by: Miod Vallat <miod.vallat@powerdns.com>
pdns/dnsdistdist/bpf-filter.cc
pdns/dnsdistdist/bpf-filter.qname.ebpf