Add check to disable adaptive rate limiting

Disable when targeting Linux kernels that do not support Unix socket
monitoring (UNIX_DIAG), like the default OpenWrt kernel.

This will avoid flooding the log with this error message:
	NLM query failed

Signed-off-by: Dimitri Papadopoulos <3350651-DimitriPapadopoulos@users.noreply.gitlab.com>
This commit is contained in:
Dimitri Papadopoulos
2026-04-17 21:58:37 +02:00
parent da90b76b07
commit 99650ec7cb
2 changed files with 16 additions and 4 deletions
+15 -4
View File
@@ -276,10 +276,21 @@ if not get_option('latency-stats').disabled()
prefix: '#include <time.h>\n#include <linux/errqueue.h>')
endif
adaptive_rate = cc.has_header('linux/netlink.h') and \
cc.has_header('linux/rtnetlink.h') and \
cc.has_header('linux/sock_diag.h') and \
cc.has_header('linux/unix_diag.h')
adaptive_rate = false
adaptive_rate_option = get_option('sock-diag')
if not adaptive_rate_option.disabled()
have_sockdiag_headers = (
cc.has_header('linux/netlink.h') and
cc.has_header('linux/rtnetlink.h') and
cc.has_header('linux/sock_diag.h') and
cc.has_header('linux/unix_diag.h')
)
if have_sockdiag_headers
adaptive_rate = true
elif adaptive_rate_option.enabled()
error('sock-diag requested but required headers not found')
endif
endif
proc_fs = fs.exists('/proc/self/exe')
+1
View File
@@ -15,6 +15,7 @@ option('anyconnect-compat', type: 'feature', value: 'enabled', description: 'Ci
option('namespaces', type: 'feature', value: 'enabled', description: 'Linux network namespace support')
option('utmp', type: 'feature', value: 'auto', description: 'utmp support via libutil')
option('libwrap', type: 'feature', value: 'auto', description: 'TCP wrappers support via libwrap')
option('sock-diag', type: 'feature', value: 'auto', description: 'Use the sock_diag netlink subsystem for adaptive rate limiting')
option('local-talloc', type: 'boolean', value: false, description: 'Force use of bundled talloc')
option('local-llhttp', type: 'boolean', value: true, description: 'Use bundled llhttp (default); false to require system llhttp')
option('local-protobuf', type: 'boolean', value: false, description: 'Force use of bundled protobuf-c')