netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] mctp: return -ENOPROTOOPT for unknown getsockopt options
@ 2025-09-02 10:20 Alok Tiwari
  2025-09-04  0:30 ` patchwork-bot+netdevbpf
  0 siblings, 1 reply; 2+ messages in thread
From: Alok Tiwari @ 2025-09-02 10:20 UTC (permalink / raw)
  To: jk, matt, davem, edumazet, kuba, pabeni, horms, netdev; +Cc: alok.a.tiwari

In mctp_getsockopt(), unrecognized options currently return -EINVAL.
In contrast, mctp_setsockopt() returns -ENOPROTOOPT for unknown
options.

Update mctp_getsockopt() to also return -ENOPROTOOPT for unknown
options. This aligns the behavior of getsockopt() and setsockopt(),
and matches the standard kernel socket API convention for handling
unsupported options.

Fixes: 99ce45d5e7db ("mctp: Implement extended addressing")
Signed-off-by: Alok Tiwari <alok.a.tiwari@oracle.com>
---
 net/mctp/af_mctp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/mctp/af_mctp.c b/net/mctp/af_mctp.c
index df4e8cf33899..685524800d70 100644
--- a/net/mctp/af_mctp.c
+++ b/net/mctp/af_mctp.c
@@ -425,7 +425,7 @@ static int mctp_getsockopt(struct socket *sock, int level, int optname,
 		return 0;
 	}
 
-	return -EINVAL;
+	return -ENOPROTOOPT;
 }
 
 /* helpers for reading/writing the tag ioc, handling compatibility across the
-- 
2.50.1


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

* Re: [PATCH net] mctp: return -ENOPROTOOPT for unknown getsockopt options
  2025-09-02 10:20 [PATCH net] mctp: return -ENOPROTOOPT for unknown getsockopt options Alok Tiwari
@ 2025-09-04  0:30 ` patchwork-bot+netdevbpf
  0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2025-09-04  0:30 UTC (permalink / raw)
  To: Alok Tiwari; +Cc: jk, matt, davem, edumazet, kuba, pabeni, horms, netdev

Hello:

This patch was applied to netdev/net.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Tue,  2 Sep 2025 03:20:55 -0700 you wrote:
> In mctp_getsockopt(), unrecognized options currently return -EINVAL.
> In contrast, mctp_setsockopt() returns -ENOPROTOOPT for unknown
> options.
> 
> Update mctp_getsockopt() to also return -ENOPROTOOPT for unknown
> options. This aligns the behavior of getsockopt() and setsockopt(),
> and matches the standard kernel socket API convention for handling
> unsupported options.
> 
> [...]

Here is the summary with links:
  - [net] mctp: return -ENOPROTOOPT for unknown getsockopt options
    https://git.kernel.org/netdev/net/c/a125c8fb9ddb

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



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

end of thread, other threads:[~2025-09-04  0:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-02 10:20 [PATCH net] mctp: return -ENOPROTOOPT for unknown getsockopt options Alok Tiwari
2025-09-04  0:30 ` patchwork-bot+netdevbpf

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).