Skip to content

Commit

Permalink
[firewall] Query kernel version first for detecting nftables support
Browse files Browse the repository at this point in the history
Calling iptables-nft on a kernel that doesn't support it is not a Good Thing.

Fixes #2183
  • Loading branch information
Chris Townsend committed Aug 4, 2021
1 parent 2126b95 commit 8e0fa20
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/platform/backends/qemu/firewall_config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ QString detect_firewall()
QString firewall_exec;
try
{
firewall_exec = (is_firewall_in_use(nftables) || (!is_firewall_in_use(iptables) && kernel_supports_nftables()))
firewall_exec = kernel_supports_nftables() && (is_firewall_in_use(nftables) || !is_firewall_in_use(iptables))
? nftables
: iptables;
}
Expand Down

0 comments on commit 8e0fa20

Please sign in to comment.