From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Florian Westphal <fw@strlen.de>
Cc: netfilter-devel@vger.kernel.org
Subject: Re: [PATCH nf] netfilter: use get_random_u32 instead of prandom
Date: Wed, 18 May 2022 23:21:30 +0200 [thread overview]
Message-ID: <YoVjWp5NhWIyK7gu@salvia> (raw)
In-Reply-To: <20220518181531.92593-1-fw@strlen.de>
On Wed, May 18, 2022 at 08:15:31PM +0200, Florian Westphal wrote:
[...]
> @@ -389,7 +381,7 @@ void nft_meta_get_eval(const struct nft_expr *expr,
> break;
> #endif
> case NFT_META_PRANDOM:
> - *dest = nft_prandom_u32();
> + *dest = get_random_u32();
get_random_u32() uses a spinlock and it disables irq while my patch
uses per-cpu and bh.
spinlock ok, but disabling irq is not necessary. Also this function is
called from control plane path by most users?
next prev parent reply other threads:[~2022-05-18 21:21 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-18 18:15 [PATCH nf] netfilter: use get_random_u32 instead of prandom Florian Westphal
2022-05-18 21:21 ` Pablo Neira Ayuso [this message]
2022-05-18 21:54 ` Florian Westphal
2022-06-08 10:33 ` 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=YoVjWp5NhWIyK7gu@salvia \
--to=pablo@netfilter.org \
--cc=fw@strlen.de \
--cc=netfilter-devel@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).