diff options
author | Jakub Kicinski <kuba@kernel.org> | 2020-10-06 01:07:36 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-10-06 16:25:55 +0300 |
commit | 329d9c333ee4a904341d555b72cd6218f4104d53 (patch) | |
tree | 21ad16925587cc34e707ba4f7585919f193f8ba9 /net/ethtool/linkmodes.c | |
parent | ff419afa43109e05d42d75629f21d9fd87f635ea (diff) | |
download | linux-329d9c333ee4a904341d555b72cd6218f4104d53.tar.xz |
ethtool: link up ethnl_header_policy as a nested policy
To get the most out of parsing by the core, and to allow dumping
full policies we need to specify which policy applies to nested
attrs. For headers it's ethnl_header_policy.
$ sed -i 's@\(ETHTOOL_A_.*HEADER\].*=\) { .type = NLA_NESTED },@\1\n\t\tNLA_POLICY_NESTED(ethnl_header_policy),@' net/ethtool/*
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ethtool/linkmodes.c')
-rw-r--r-- | net/ethtool/linkmodes.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/net/ethtool/linkmodes.c b/net/ethtool/linkmodes.c index dcef79b6a2d2..c5bcb9abc8b9 100644 --- a/net/ethtool/linkmodes.c +++ b/net/ethtool/linkmodes.c @@ -19,7 +19,8 @@ struct linkmodes_reply_data { container_of(__reply_base, struct linkmodes_reply_data, base) const struct nla_policy ethnl_linkmodes_get_policy[] = { - [ETHTOOL_A_LINKMODES_HEADER] = { .type = NLA_NESTED }, + [ETHTOOL_A_LINKMODES_HEADER] = + NLA_POLICY_NESTED(ethnl_header_policy), }; static int linkmodes_prepare_data(const struct ethnl_req_info *req_base, @@ -266,7 +267,8 @@ static const struct link_mode_info link_mode_params[] = { }; const struct nla_policy ethnl_linkmodes_set_policy[] = { - [ETHTOOL_A_LINKMODES_HEADER] = { .type = NLA_NESTED }, + [ETHTOOL_A_LINKMODES_HEADER] = + NLA_POLICY_NESTED(ethnl_header_policy), [ETHTOOL_A_LINKMODES_AUTONEG] = { .type = NLA_U8 }, [ETHTOOL_A_LINKMODES_OURS] = { .type = NLA_NESTED }, [ETHTOOL_A_LINKMODES_SPEED] = { .type = NLA_U32 }, |