[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <248a5646-9dc8-c640-e334-31e9d50495e8@gmail.com>
Date: Fri, 2 Oct 2020 07:29:35 -0700
From: David Ahern <dsahern@...il.com>
To: Johannes Berg <johannes@...solutions.net>, netdev@...r.kernel.org
Cc: Jakub Kicinski <kuba@...nel.org>
Subject: Re: [PATCH] genl: ctrl: print op -> policy idx mapping
On 10/2/20 3:26 AM, Johannes Berg wrote:
> diff --git a/genl/ctrl.c b/genl/ctrl.c
> index 68099fe97f1a..c62212b40fa3 100644
> --- a/genl/ctrl.c
> +++ b/genl/ctrl.c
> @@ -162,6 +162,16 @@ static int print_ctrl(struct rtnl_ctrl_data *ctrl,
> __u32 *ma = RTA_DATA(tb[CTRL_ATTR_MAXATTR]);
> fprintf(fp, " max attribs: %d ",*ma);
> }
> + if (tb[CTRL_ATTR_OP_POLICY]) {
> + const struct rtattr *pos;
> +
> + rtattr_for_each_nested(pos, tb[CTRL_ATTR_OP_POLICY]) {
> + __u32 *v = RTA_DATA(pos);
> +
> + fprintf(fp, " op %d has policy %d",
> + pos->rta_type, *v);
did you look at pretty printing the op and type? I suspect only numbers
are going to cause a lot of staring at header files while counting to
decipher number to text.
Powered by blists - more mailing lists