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 :)