Skip to content

Commit dec6117

Browse files
aloktiwagregkh
authored andcommitted
mctp: return -ENOPROTOOPT for unknown getsockopt options
[ Upstream commit a125c8f ] 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: 99ce45d ("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>
1 parent e5ea334 commit dec6117

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/mctp/af_mctp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ static int mctp_getsockopt(struct socket *sock, int level, int optname,
346346
return 0;
347347
}
348348

349-
return -EINVAL;
349+
return -ENOPROTOOPT;
350350
}
351351

352352
/* helpers for reading/writing the tag ioc, handling compatibility across the

0 commit comments

Comments
 (0)