aboutsummaryrefslogtreecommitdiffstats
path: root/net/mctp/af_mctp.c
diff options
context:
space:
mode:
authorAlok Tiwari <[email protected]>2025-09-02 10:20:55 +0000
committerJakub Kicinski <[email protected]>2025-09-04 00:01:52 +0000
commita125c8fb9ddbcb0602103a50727a476fd30dec01 (patch)
tree7710a8fc825d66664ad835056f2f152917942f28 /net/mctp/af_mctp.c
parentnet/smc: Remove validation of reserved bits in CLC Decline message (diff)
downloadkernel-a125c8fb9ddbcb0602103a50727a476fd30dec01.tar.gz
kernel-a125c8fb9ddbcb0602103a50727a476fd30dec01.zip
mctp: return -ENOPROTOOPT for unknown getsockopt options
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 <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
Diffstat (limited to 'net/mctp/af_mctp.c')
-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 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