[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <a719bd37-9e60-8ce2-c5d5-cbc9195a4f62@mojatatu.com>
Date: Tue, 2 May 2017 21:52:19 -0400
From: Jamal Hadi Salim <jhs@...atatu.com>
To: David Miller <davem@...emloft.net>
Cc: netdev@...r.kernel.org, jiri@...nulli.us, xiyou.wangcong@...il.com
Subject: Re: [PATCH net-next RFC 1/1] net netlink: Add new type NLA_FLAG_BITS
On 17-05-02 03:03 PM, David Miller wrote:
> From: Jamal Hadi Salim <jhs@...atatu.com>
> Date: Sun, 30 Apr 2017 10:28:39 -0400
>
>> Generic bitflags attribute content sent to the kernel by user.
>> With this type the user can either set or unset a flag in the
>> kernel.
>
> You asked for feedback, here it is :-)
>
> I think this is overengineered.
>
> Just define a u32 for the value, and mask which defines which bits are
> legitimate and defined. Any bit outside of the legitimate mask must
> be zero.
>
That is what it does but as a nla type. It has a validator ops() in
case someone wants to override the default validator.
Is the ops the over-engineering you refer to or merely making it an
nla type is a problem?
cheers,
jamal
Powered by blists - more mailing lists