Re: [patch net-next v3 16/17] bridge: add brport flags to dflt bridge_getlink

Thomas Graf
2014-11-26T10:48:18Z

On 11/26/14 at 10:25am, Jiri Pirko wrote:
> Tue, Nov 25, 2014 at 11:07:53PM CET, tgraf@suug.ch wrote:
> >> +static int brport_nla_put_flag(struct sk_buff *skb, u32 flags, u32 mask,
> >> + unsigned int attrnum, unsigned int flag)
> >> +{
> >> + if (mask & flag)
> >> + return nla_put_u8(skb, attrnum, !!(flags & flag));
> >
> >nla_put_flag()?
>
> No, that is not the same. nla_put_flag works differently. The attr is
> either present or not. But in this case, attr is always present and has
> value of either 0 or 1.

So this reports the driver capabilities through this interface as
well. Cool. Wasn't obvious to me before but that justifies the waste.