summaryrefslogtreecommitdiffstats
path: root/net/ethtool/features.c
diff options
context:
space:
mode:
authorJakub Kicinski <kuba@kernel.org>2020-10-06 00:07:34 +0200
committerDavid S. Miller <davem@davemloft.net>2020-10-06 15:25:55 +0200
commit5028588b62cbda74744f4f28b35f618e5b1078ef (patch)
tree6277b1150e043132ef78a7a8acb944453eab5345 /net/ethtool/features.c
parentethtool: wire up get policies to ops (diff)
downloadlinux-5028588b62cbda74744f4f28b35f618e5b1078ef.tar.xz
linux-5028588b62cbda74744f4f28b35f618e5b1078ef.zip
ethtool: wire up set policies to ops
Similarly to get commands wire up the policies of set commands to get parsing by the core and policy dumps. Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ethtool/features.c')
-rw-r--r--net/ethtool/features.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/net/ethtool/features.c b/net/ethtool/features.c
index bc1b1c74b1f5..e4a91d86824d 100644
--- a/net/ethtool/features.c
+++ b/net/ethtool/features.c
@@ -130,8 +130,8 @@ const struct ethnl_request_ops ethnl_features_request_ops = {
/* FEATURES_SET */
-static const struct nla_policy
-features_set_policy[ETHTOOL_A_FEATURES_MAX + 1] = {
+const struct nla_policy
+ethnl_features_set_policy[ETHTOOL_A_FEATURES_MAX + 1] = {
[ETHTOOL_A_FEATURES_UNSPEC] = { .type = NLA_REJECT },
[ETHTOOL_A_FEATURES_HEADER] = { .type = NLA_NESTED },
[ETHTOOL_A_FEATURES_HW] = { .type = NLA_REJECT },
@@ -227,17 +227,12 @@ int ethnl_set_features(struct sk_buff *skb, struct genl_info *info)
DECLARE_BITMAP(new_wanted, NETDEV_FEATURE_COUNT);
DECLARE_BITMAP(req_wanted, NETDEV_FEATURE_COUNT);
DECLARE_BITMAP(req_mask, NETDEV_FEATURE_COUNT);
- struct nlattr *tb[ETHTOOL_A_FEATURES_MAX + 1];
struct ethnl_req_info req_info = {};
+ struct nlattr **tb = info->attrs;
struct net_device *dev;
bool mod;
int ret;
- ret = nlmsg_parse(info->nlhdr, GENL_HDRLEN, tb,
- ETHTOOL_A_FEATURES_MAX, features_set_policy,
- info->extack);
- if (ret < 0)
- return ret;
if (!tb[ETHTOOL_A_FEATURES_WANTED])
return -EINVAL;
ret = ethnl_parse_header_dev_get(&req_info,