* [PATCH 1/1] netlink: allow nl_sset return -EOPNOTSUPP to fallback to do_sset
@ 2023-08-10 12:53 Gang Li
2023-08-10 17:01 ` Jakub Kicinski
0 siblings, 1 reply; 3+ messages in thread
From: Gang Li @ 2023-08-10 12:53 UTC (permalink / raw)
To: Michal Kubecek; +Cc: netdev
netlink: Allow nl_sset return -EOPNOTSUPP to fallback to do_sset
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 9aad8d9..a506618 100644
--- a/netlink/settings.c
+++ b/netlink/settings.c
@@ -1342,6 +1342,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] 3+ messages in thread
* Re: [PATCH 1/1] netlink: allow nl_sset return -EOPNOTSUPP to fallback to do_sset
2023-08-10 12:53 [PATCH 1/1] netlink: allow nl_sset return -EOPNOTSUPP to fallback to do_sset Gang Li
@ 2023-08-10 17:01 ` Jakub Kicinski
2023-08-11 2:45 ` Gang Li
0 siblings, 1 reply; 3+ messages in thread
From: Jakub Kicinski @ 2023-08-10 17:01 UTC (permalink / raw)
To: Gang Li; +Cc: Michal Kubecek, netdev
On Thu, 10 Aug 2023 20:53:02 +0800 Gang Li wrote:
> Subject: [PATCH 1/1] netlink: allow nl_sset return -EOPNOTSUPP to fallback to do_sset
Please make sure to add the project to the subject next time.
[PATCH ethtool]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH 1/1] netlink: allow nl_sset return -EOPNOTSUPP to fallback to do_sset
2023-08-10 17:01 ` Jakub Kicinski
@ 2023-08-11 2:45 ` Gang Li
0 siblings, 0 replies; 3+ messages in thread
From: Gang Li @ 2023-08-11 2:45 UTC (permalink / raw)
To: Jakub Kicinski; +Cc: Michal Kubecek, netdev, gang.li
On 2023/8/11 01:01, Jakub Kicinski wrote:
> On Thu, 10 Aug 2023 20:53:02 +0800 Gang Li wrote:
>> Subject: [PATCH 1/1] netlink: allow nl_sset return -EOPNOTSUPP to fallback to do_sset
>
> Please make sure to add the project to the subject next time.
> [PATCH ethtool]
Sure, thanks!
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-08-11 2:54 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-10 12:53 [PATCH 1/1] netlink: allow nl_sset return -EOPNOTSUPP to fallback to do_sset Gang Li
2023-08-10 17:01 ` Jakub Kicinski
2023-08-11 2:45 ` Gang Li
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).