From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Thomas Haller <thaller@redhat.com>
Cc: NetFilter <netfilter-devel@vger.kernel.org>
Subject: Re: [PATCH nft 2/2] libnftables: move init-once guard inside xt_init()
Date: Tue, 19 Sep 2023 15:42:52 +0200 [thread overview]
Message-ID: <ZQmlXJA0qjRgGBAp@calendula> (raw)
In-Reply-To: <20230919123621.2770734-2-thaller@redhat.com>
On Tue, Sep 19, 2023 at 02:36:17PM +0200, Thomas Haller wrote:
> 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.
Also applied, thanks
next prev parent reply other threads:[~2023-09-19 13:44 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-19 12:36 [PATCH nft 1/2] libnftables: drop gmp_init() and mp_set_memory_functions() Thomas Haller
2023-09-19 12:36 ` [PATCH nft 2/2] libnftables: move init-once guard inside xt_init() Thomas Haller
2023-09-19 13:42 ` Pablo Neira Ayuso [this message]
2023-09-19 13:42 ` [PATCH nft 1/2] libnftables: drop gmp_init() and mp_set_memory_functions() Pablo Neira Ayuso
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZQmlXJA0qjRgGBAp@calendula \
--to=pablo@netfilter.org \
--cc=netfilter-devel@vger.kernel.org \
--cc=thaller@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox