[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20160426121850.GC20950@soda.linbit>
Date: Tue, 26 Apr 2016 14:18:50 +0200
From: Lars Ellenberg <lars.ellenberg@...bit.com>
To: Nicolas Dichtel <nicolas.dichtel@...nd.com>,
netdev@...r.kernel.org, davem@...emloft.net, sd@...asysnail.net,
johannes@...solutions.net, kvalo@...eaurora.org,
linux-wireless@...r.kernel.org, jack@...e.com,
linux-kernel@...r.kernel.org, pshelar@...ira.com,
dev@...nvswitch.org, jhs@...atatu.com, philipp.reisner@...bit.com,
drbd-dev@...ts.linbit.com
Subject: Re: [Drbd-dev] [PATCH net-next 0/8] netlink: align attributes when
needed (patchset #3)
On Tue, Apr 26, 2016 at 01:54:27PM +0200, Lars Ellenberg wrote:
> On Tue, Apr 26, 2016 at 10:06:10AM +0200, Nicolas Dichtel wrote:
> >
> > This is the continuation (series #3) of the work done to align netlink
> > attributes when these attributes contain some 64-bit fields.
> >
> > It's the last patchset from what I've seen.
> >
> > The last user of nla_put_u64() is block/drbd. This module does not use
> > standard netlink API (see all the stuff in include/linux/genl_magic_struct.h
> > and include/linux/genl_magic_func.h). I didn't modify it because it's seems
> > hard to do it whithout testing and fully understanding the context
>
> Something like this should just work.
> + * @attrtype: attribute type
> + * @value: numeric value
> + */
> +static inline int nla_put_u64_64bit_unspec(struct sk_buff *skb, int attrtype,
> + u64 value)
> +{
> + return nla_put_64bit(skb, attrtype, sizeof(u64), &value, NLA_UNSPEC);
Ok, I confused attribute and policy type there for a sec.
Anyways, 0 works just fine,
all our nested attribute enums are != 0,
because nla_parse skips type 0.
Lars
Powered by blists - more mailing lists