[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20201005122544.70aad7f5@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com>
Date: Mon, 5 Oct 2020 12:25:44 -0700
From: Jakub Kicinski <kuba@...nel.org>
To: Johannes Berg <johannes@...solutions.net>
Cc: davem@...emloft.net, netdev@...r.kernel.org, kernel-team@...com,
jiri@...nulli.us, andrew@...n.ch, mkubecek@...e.cz
Subject: Re: [PATCH net-next 6/6] ethtool: specify which header flags are
supported per command
On Mon, 05 Oct 2020 20:58:57 +0200 Johannes Berg wrote:
> On Mon, 2020-10-05 at 08:57 -0700, Jakub Kicinski wrote:
> >
> > @@ -47,19 +61,16 @@ int ethnl_parse_header_dev_get(struct ethnl_req_info *req_info,
> > NL_SET_ERR_MSG(extack, "request header missing");
> > return -EINVAL;
> > }
> > + /* Use most permissive header policy here, ops should specify their
> > + * actual header policy via NLA_POLICY_NESTED(), and the real
> > + * validation will happen in genetlink code.
> > + */
> > ret = nla_parse_nested(tb, ETHTOOL_A_HEADER_MAX, header,
> > - ethnl_header_policy, extack);
> > + ethnl_header_policy_stats, extack);
>
> Would it make sense to just remove the validation here? It's already
> done, so it just costs extra cycles and can't really fail, and if there
> are more diverse policies in the future this might also very quickly get
> out of hand?
I was slightly worried I missed a command and need last line of defence,
but you're right, I'll just pass a NULL for the policy in v2 :)
Powered by blists - more mailing lists