[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <f608f1dc2d522a32a6cedbd44a6213c4d231464b.camel@sipsolutions.net>
Date: Wed, 19 Oct 2022 10:08:01 +0200
From: Johannes Berg <johannes@...solutions.net>
To: Jakub Kicinski <kuba@...nel.org>, davem@...emloft.net
Cc: netdev@...r.kernel.org, edumazet@...gle.com, pabeni@...hat.com,
jiri@...nulli.us, razor@...ckwall.org, nicolas.dichtel@...nd.com,
gnault@...hat.com, jacob.e.keller@...el.com, fw@...len.de
Subject: Re: [PATCH net-next 06/13] genetlink: add policies for both doit
and dumpit in ctrl_dumppolicy_start()
On Tue, 2022-10-18 at 16:07 -0700, Jakub Kicinski wrote:
>
>
> - if (!op.policy)
> - return -ENODATA;
> + if (doit.policy) {
> + err = netlink_policy_dump_add_policy(&ctx->state,
> + doit.policy,
> + doit.maxattr);
> + if (err)
> + goto err_free_state;
> + }
> + if (dump.policy) {
nit: to me a blank line in places like that would be nicer, but ymmv
> for (i = 0; i < genl_get_cmd_cnt(rt); i++) {
> + struct genl_split_ops doit, dumpit;
> +
> genl_get_cmd_by_index(i, rt, &op);
>
> - if (op.policy) {
> + genl_cmd_full_to_split(&doit, ctx->rt, &op, GENL_CMD_CAP_DO);
> + genl_cmd_full_to_split(&dumpit, ctx->rt,
> + &op, GENL_CMD_CAP_DUMP);
> +
> + if (doit.policy) {
> + err = netlink_policy_dump_add_policy(&ctx->state,
> + doit.policy,
> + doit.maxattr);
> + if (err)
> + goto err_free_state;
> + }
> + if (dumpit.policy) {
same here
johannes
Powered by blists - more mailing lists