]> git.ipfire.org Git - thirdparty/systemd.git/commit
firewall-util: probe firewall backend in fw_ctx_new()
authorYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 23 Mar 2021 05:38:18 +0000 (14:38 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 23 Mar 2021 06:17:34 +0000 (15:17 +0900)
commitdfb433f2a77a04d44aaa64d8364805e36cb25f5a
treeff4d03e2bd360d3ee0bba70a1b0f090903b32dc6
parent4fb8a48ff09a214a792ecc1d699ed764edc04efd
firewall-util: probe firewall backend in fw_ctx_new()

FirewallContext is used by networkd and nspawn. Both allocates the
context when it is really necessary. Hence, it is not necessary to delay
probing backend.

Moreover, if iptables backend is not enabled on build, and nftables is
not supported by kernel, previously `fw_nftables_init()` is called
everytime when we try to configure masquerade or dnat. It causes
significant performance loss.

Fixes test-firewall-util issue in #19052.
src/shared/firewall-util.c