netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH RESEND ethtool] netlink: Allow nl_sset return -EOPNOTSUPP to fallback to do_sset
@ 2023-08-21  3:34 Gang Li
  2023-08-27 23:23 ` Michal Kubecek
  0 siblings, 1 reply; 2+ messages in thread
From: Gang Li @ 2023-08-21  3:34 UTC (permalink / raw)
  To: mkubecek; +Cc: netdev, linux-kernel, kuba, Gang Li

Currently, nl_sset treats any negative value returned by nl_parser
(including -EOPNOTSUPP) as `1`. Consequently, netlink_run_handler
directly calls exit without returning to main and invoking do_sset
through ioctl_init.

To fallback to do_sset, this commit allows nl_sset return -EOPNOTSUPP.

Fixes: 392b12e ("netlink: add netlink handler for sset (-s)")
Signed-off-by: Gang Li <gang.li@linux.dev>
---
 netlink/settings.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/netlink/settings.c b/netlink/settings.c
index dda4ac9..2af933d 100644
--- a/netlink/settings.c
+++ b/netlink/settings.c
@@ -1244,6 +1244,9 @@ int nl_sset(struct cmd_context *ctx)
 	nlctx->devname = ctx->devname;
 
 	ret = nl_parser(nlctx, sset_params, NULL, PARSER_GROUP_MSG, msgbuffs);
+	if (ret == -EOPNOTSUPP)
+		return ret;
+
 	if (ret < 0) {
 		ret = 1;
 		goto out_free;
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH RESEND ethtool] netlink: Allow nl_sset return -EOPNOTSUPP to fallback to do_sset
  2023-08-21  3:34 [PATCH RESEND ethtool] netlink: Allow nl_sset return -EOPNOTSUPP to fallback to do_sset Gang Li
@ 2023-08-27 23:23 ` Michal Kubecek
  0 siblings, 0 replies; 2+ messages in thread
From: Michal Kubecek @ 2023-08-27 23:23 UTC (permalink / raw)
  To: Gang Li; +Cc: netdev, linux-kernel, kuba

[-- Attachment #1: Type: text/plain, Size: 711 bytes --]

On Mon, Aug 21, 2023 at 11:34:19AM +0800, Gang Li wrote:
> Currently, nl_sset treats any negative value returned by nl_parser
> (including -EOPNOTSUPP) as `1`. Consequently, netlink_run_handler
> directly calls exit without returning to main and invoking do_sset
> through ioctl_init.
> 
> To fallback to do_sset, this commit allows nl_sset return -EOPNOTSUPP.
> 
> Fixes: 392b12e ("netlink: add netlink handler for sset (-s)")
> Signed-off-by: Gang Li <gang.li@linux.dev>

Applied, thank you.

I only changed the Fixes tag to commit 6c19c0d559c8 ("netlink: use
genetlink ops information to decide about fallback") as that's where the
need for special handling of -EOPNOTSUPP started.

Michal

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-08-27 23:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-21  3:34 [PATCH RESEND ethtool] netlink: Allow nl_sset return -EOPNOTSUPP to fallback to do_sset Gang Li
2023-08-27 23:23 ` Michal Kubecek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).