mirror of
https://github.com/torvalds/linux
synced 2024-09-21 03:28:37 +00:00
SO_ZEROCOPY should return -EOPNOTSUPP rather than -ENOTSUPP
ENOTSUPP is documented as "should never be seen by user programs", and thus not exposed in <errno.h>, and thus applications cannot safely check against it (they get "Unknown error 524" as strerror). We should rather return the well-known -EOPNOTSUPP. This is similar to2230a7ef51
("drop_monitor: Use correct error code") and4a5cdc604b
("net/tls: Fix return values to avoid ENOTSUPP"), which did not seem to cause problems. Signed-off-by: Samuel Thibault <samuel.thibault@labri.fr> Acked-by: Willem de Bruijn <willemb@google.com> Link: https://lore.kernel.org/r/20220307223126.djzvg44v2o2jkjsx@begin Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
964efdab03
commit
869420a8be
|
@ -1377,9 +1377,9 @@ int sock_setsockopt(struct socket *sock, int level, int optname,
|
|||
if (!(sk_is_tcp(sk) ||
|
||||
(sk->sk_type == SOCK_DGRAM &&
|
||||
sk->sk_protocol == IPPROTO_UDP)))
|
||||
ret = -ENOTSUPP;
|
||||
ret = -EOPNOTSUPP;
|
||||
} else if (sk->sk_family != PF_RDS) {
|
||||
ret = -ENOTSUPP;
|
||||
ret = -EOPNOTSUPP;
|
||||
}
|
||||
if (!ret) {
|
||||
if (val < 0 || val > 1)
|
||||
|
|
Loading…
Reference in a new issue