Skip to content

Commit a125c8f

Browse files
aloktiwakuba-moo
authored andcommitted
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: 99ce45d ("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]>
1 parent cc282f7 commit a125c8f

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
@@ -425,7 +425,7 @@ static int mctp_getsockopt(struct socket *sock, int level, int optname,
425425
return 0;
426426
}
427427

428-
return -EINVAL;
428+
return -ENOPROTOOPT;
429429
}
430430

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

0 commit comments

Comments
 (0)