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

Thomas Graf
2014-11-25T22:07:57Z

On 11/25/14 at 11:28am, Jiri Pirko wrote:
> From: Scott Feldman <sfeldma@gmail.com>
>
> To allow brport device to return current brport flags set on port. Add
> returned flags to nested IFLA_PROTINFO netlink msg built in dflt getlink.
> With this change, netlink msg returned for bridge_getlink contains the port's
> offloaded flag settings (the port's SELF settings).
>
> Signed-off-by: Scott Feldman <sfeldma@gmail.com>
> Signed-off-by: Jiri Pirko <jiri@resnulli.us>

Minor nit below. Otherwise:

Acked-by: Thomas Graf <tgraf@suug.ch>

> diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
> index bd5e783..91e5368 100644
> --- a/net/core/rtnetlink.c
> +++ b/net/core/rtnetlink.c
> @@ -2687,12 +2687,22 @@ static int rtnl_fdb_dump(struct sk_buff *skb, struct netlink_callback *cb)
> return skb->len;
> }
>
> +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()?