summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2023-09-19 14:36:17 +0200
committerPablo Neira Ayuso <pablo@netfilter.org>2023-09-19 17:26:27 +0200
commitdac1fbe3d35bf5e78320c4402718628866ed9d0a (patch)
tree96bf2bfe7f5b7fbd011518147b68e0633a898204 /tests
parent96ee78ec4a0707114d2f8ef7590d08cfd25080ea (diff)
libnftables: move init-once guard inside xt_init()
A library should not restrict being used by multiple threads or make assumptions about how it's being used. Hence a "init_once" pattern without no locking is racy, a code smell and should be avoided. Note that libxtables is full of global variables and when linking against it, libnftables cannot be used from multiple threads either. That is not easy to fix. Move the ugliness of "init_once" away from nft_ctx_new(), so that the problem is concentrated closer to libxtables. Signed-off-by: Thomas Haller <thaller@redhat.com> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'tests')
0 files changed, 0 insertions, 0 deletions