meson: nftables is preferred unless iptables is explicitly requested

Relates: #709

Signed-off-by: Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
This commit is contained in:
Nikos Mavrogiannopoulos
2026-05-01 22:17:04 +02:00
parent ac5ee6a10b
commit dda2015aa4
2 changed files with 2 additions and 8 deletions
+1 -7
View File
@@ -41,15 +41,9 @@ endif
gperf = find_program('gperf', required: false) gperf = find_program('gperf', required: false)
protoc_c = find_program('protoc-c', required: false) protoc_c = find_program('protoc-c', required: false)
ipcalc = find_program(['ipcalc', 'ipcalc-ng'], required: true) ipcalc = find_program(['ipcalc', 'ipcalc-ng'], required: true)
nft_prog = find_program('nft', required: false)
# Firewall script selection # Firewall script selection
_fw_opt = get_option('firewall-script') _fw_opt = get_option('firewall-script')
if _fw_opt == 'auto' fw_script_type = (_fw_opt == 'auto') ? 'nftables' : _fw_opt
fw_script_type = nft_prog.found() ? 'nftables' : 'iptables'
else
fw_script_type = _fw_opt
endif
message('firewall script: ' + fw_script_type) message('firewall script: ' + fw_script_type)
# -------------------------------------------------------------------------- # --------------------------------------------------------------------------
+1 -1
View File
@@ -26,4 +26,4 @@ option('tun-tests', type: 'boolean', value: true, description: 'En
option('kerberos-tests', type: 'boolean', value: false, description: 'Enable tests requiring a Kerberos setup') option('kerberos-tests', type: 'boolean', value: false, description: 'Enable tests requiring a Kerberos setup')
option('with-werror', type: 'boolean', value: false, description: 'Treat compiler warnings as errors') option('with-werror', type: 'boolean', value: false, description: 'Treat compiler warnings as errors')
option('pager', type: 'string', value: 'less', description: 'Default pager for occtl (empty string for none)') option('pager', type: 'string', value: 'less', description: 'Default pager for occtl (empty string for none)')
option('firewall-script', type: 'combo', choices: ['auto', 'nftables', 'iptables'], value: 'auto', description: 'Firewall script backend (auto prefers nftables if nft is found)') option('firewall-script', type: 'combo', choices: ['auto', 'nftables', 'iptables'], value: 'nftables', description: 'Firewall script backend (nftables by default; auto is an alias for nftables)')