mctp: return -ENOPROTOOPT for unknown getsockopt options
authorAlok Tiwari <alok.a.tiwari@oracle.com>
Tue, 2 Sep 2025 10:20:55 +0000 (03:20 -0700)
committerJakub Kicinski <kuba@kernel.org>
Thu, 4 Sep 2025 00:01:52 +0000 (17:01 -0700)
commita125c8fb9ddbcb0602103a50727a476fd30dec01
tree7710a8fc825d66664ad835056f2f152917942f28
parentcc282f73bc0cbdf3ee7af2f2d3a2ef4e6b19242d
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 <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>
net/mctp/af_mctp.c