summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlok Tiwari <alok.a.tiwari@oracle.com>2025-09-02 03:20:55 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-09-09 19:02:27 +0200
commitdec6117dc4faf3fa7f8dfe5507d77e4eeb49e6f1 (patch)
treeb1d0c408f4ae7d607c90e32c4c46dec215a748c7
parente5ea3347004c8a3cb7ef870fd53c3714b4464e69 (diff)
mctp: return -ENOPROTOOPT for unknown getsockopt options
[ Upstream commit a125c8fb9ddbcb0602103a50727a476fd30dec01 ] 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> Link: https://patch.msgid.link/20250902102059.1370008-1-alok.a.tiwari@oracle.com Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r--net/mctp/af_mctp.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/mctp/af_mctp.c b/net/mctp/af_mctp.c
index 9d5db3feedec..4dee06171361 100644
--- a/net/mctp/af_mctp.c
+++ b/net/mctp/af_mctp.c
@@ -346,7 +346,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