From: Jakub Kicinski <kuba@kernel•org>
To: davem@davemloft•net
Cc: netdev@vger•kernel.org, edumazet@google•com, pabeni@redhat•com,
mkubecek@suse•cz, johannes@sipsolutions•net,
Jakub Kicinski <kuba@kernel•org>
Subject: [PATCH net-next 5/6] ethtool: strset: report missing ETHTOOL_A_STRINGSET_ID via ext_ack
Date: Tue, 23 Aug 2022 21:50:23 -0700 [thread overview]
Message-ID: <20220824045024.1107161-6-kuba@kernel.org> (raw)
In-Reply-To: <20220824045024.1107161-1-kuba@kernel.org>
Strset needs ETHTOOL_A_STRINGSET_ID, use it as an example of
reporting attrs missing in nests.
Signed-off-by: Jakub Kicinski <kuba@kernel•org>
---
net/ethtool/strset.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/ethtool/strset.c b/net/ethtool/strset.c
index 2d51b7ab4dc5..3f7de54d85fb 100644
--- a/net/ethtool/strset.c
+++ b/net/ethtool/strset.c
@@ -167,7 +167,7 @@ static int strset_get_id(const struct nlattr *nest, u32 *val,
get_stringset_policy, extack);
if (ret < 0)
return ret;
- if (!tb[ETHTOOL_A_STRINGSET_ID])
+ if (NL_REQ_ATTR_CHECK(extack, nest, tb, ETHTOOL_A_STRINGSET_ID))
return -EINVAL;
*val = nla_get_u32(tb[ETHTOOL_A_STRINGSET_ID]);
--
2.37.2
next prev parent reply other threads:[~2022-08-24 4:50 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-24 4:50 [PATCH net-next 0/6] netlink: support reporting missing attributes Jakub Kicinski
2022-08-24 4:50 ` [PATCH net-next 1/6] netlink: add support for ext_ack " Jakub Kicinski
2022-08-24 8:09 ` Johannes Berg
2022-08-24 8:13 ` Johannes Berg
2022-08-24 16:36 ` Jakub Kicinski
2022-08-24 4:50 ` [PATCH net-next 2/6] netlink: add helper for extack attr presence checking Jakub Kicinski
2022-08-24 4:50 ` [PATCH net-next 3/6] genetlink: add helper for checking required attrs and use it in devlink Jakub Kicinski
2022-08-24 19:44 ` Johannes Berg
2022-08-24 22:46 ` Jakub Kicinski
2022-08-24 4:50 ` [PATCH net-next 4/6] devlink: use missing attribute ext_ack Jakub Kicinski
2022-08-24 4:50 ` Jakub Kicinski [this message]
2022-08-24 4:50 ` [PATCH net-next 6/6] ethtool: report missing header via ext_ack in the default handler Jakub Kicinski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220824045024.1107161-6-kuba@kernel.org \
--to=kuba@kernel$(echo .)org \
--cc=davem@davemloft$(echo .)net \
--cc=edumazet@google$(echo .)com \
--cc=johannes@sipsolutions$(echo .)net \
--cc=mkubecek@suse$(echo .)cz \
--cc=netdev@vger$(echo .)kernel.org \
--cc=pabeni@redhat$(echo .)com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox