Thread (26 messages) flat view 26 messages, 3 authors, 2022-02-25

Re: [PATCH net-next 03/14] net: rtnetlink: RTM_GETSTATS: Allow filtering inside nests

From: Jakub Kicinski <kuba@kernel.org>
Date: 2022-02-25 16:04:26

On Fri, 25 Feb 2022 09:22:19 +0100 Petr Machata wrote:
quoted
Why use bitfield if we only use the .value, a u32 would do?  
The bitfield validates the mask as well, thereby making sure that
userspace and the kernel are in sync WRT which bits are meaningful.

Specifically in case of filtering, all meaningful bits are always going
to be the set ones. So it should be OK to just handroll the check that
value doesn't include any bits that we don't know about, and we don't
really need the mask.
Nothing that NLA_POLICY_MASK() can't do, right? Or do you mean that 
we can when user space requests _not_ to have a group reported?
 
So I can redo this as u32 if you prefer.
I think that'd be better, simplest tool for the job.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help