summaryrefslogtreecommitdiff
path: root/net/ethtool/pause.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/ethtool/pause.c')
-rw-r--r--net/ethtool/pause.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/net/ethtool/pause.c b/net/ethtool/pause.c
index f753094fc52a..ff54e3ca030d 100644
--- a/net/ethtool/pause.c
+++ b/net/ethtool/pause.c
@@ -139,8 +139,7 @@ const struct ethnl_request_ops ethnl_pause_request_ops = {
/* PAUSE_SET */
-static const struct nla_policy
-pause_set_policy[ETHTOOL_A_PAUSE_MAX + 1] = {
+const struct nla_policy ethnl_pause_set_policy[ETHTOOL_A_PAUSE_MAX + 1] = {
[ETHTOOL_A_PAUSE_UNSPEC] = { .type = NLA_REJECT },
[ETHTOOL_A_PAUSE_HEADER] = { .type = NLA_NESTED },
[ETHTOOL_A_PAUSE_AUTONEG] = { .type = NLA_U8 },
@@ -151,18 +150,14 @@ pause_set_policy[ETHTOOL_A_PAUSE_MAX + 1] = {
int ethnl_set_pause(struct sk_buff *skb, struct genl_info *info)
{
- struct nlattr *tb[ETHTOOL_A_PAUSE_MAX + 1];
struct ethtool_pauseparam params = {};
struct ethnl_req_info req_info = {};
+ struct nlattr **tb = info->attrs;
const struct ethtool_ops *ops;
struct net_device *dev;
bool mod = false;
int ret;
- ret = nlmsg_parse(info->nlhdr, GENL_HDRLEN, tb, ETHTOOL_A_PAUSE_MAX,
- pause_set_policy, info->extack);
- if (ret < 0)
- return ret;
ret = ethnl_parse_header_dev_get(&req_info,
tb[ETHTOOL_A_PAUSE_HEADER],
genl_info_net(info), info->extack,