diff options
author | Jakub Kicinski <kuba@kernel.org> | 2020-10-06 00:07:39 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-10-06 15:25:55 +0200 |
commit | a0de1cd3568749d3410c89b1c8bb70e90d61659f (patch) | |
tree | 09c011ae2e2e53713b8d3ee0e531fdfa4dbf29bd /net/ethtool/pause.c | |
parent | netlink: add mask validation (diff) | |
download | linux-a0de1cd3568749d3410c89b1c8bb70e90d61659f.tar.xz linux-a0de1cd3568749d3410c89b1c8bb70e90d61659f.zip |
ethtool: specify which header flags are supported per command
Perform header flags validation through the policy.
Only pause command supports ETHTOOL_FLAG_STATS. Create a separate
policy to be able to express that in policy dumps to user space.
Note that even though the core will validate the header policy,
it cannot record multiple layers of attributes and we have to
re-parse header sub-attrs. When doing so we could skip attribute
validation, or use most permissive policy. Opt for the former.
We will no longer return the extack cookie for flags but since
we only added first new flag in this release it's not expected
that any user space had a chance to make use of it.
v2: - remove the re-validation in ethnl_parse_header_dev_get()
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ethtool/pause.c')
-rw-r--r-- | net/ethtool/pause.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/ethtool/pause.c b/net/ethtool/pause.c index bf4013afd8b2..09998dc5c185 100644 --- a/net/ethtool/pause.c +++ b/net/ethtool/pause.c @@ -18,7 +18,7 @@ struct pause_reply_data { const struct nla_policy ethnl_pause_get_policy[] = { [ETHTOOL_A_PAUSE_HEADER] = - NLA_POLICY_NESTED(ethnl_header_policy), + NLA_POLICY_NESTED(ethnl_header_policy_stats), }; static void ethtool_stats_init(u64 *stats, unsigned int n) |