diff options
author | Samuel Thibault <samuel.thibault@labri.fr> | 2022-03-07 23:31:26 +0100 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2022-03-08 22:14:49 -0800 |
commit | 869420a8be1982a0be5a934860270058431c9771 (patch) | |
tree | 40d40a7c18f13ae5dbf5844523bb4708476700d9 /net/core/sock.c | |
parent | 964efdab03490d40d8e458b6a1ddf02aae212567 (diff) |
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 to 2230a7ef5198 ("drop_monitor: Use correct error
code") and 4a5cdc604b9c ("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>
Diffstat (limited to 'net/core/sock.c')
-rw-r--r-- | net/core/sock.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/net/core/sock.c b/net/core/sock.c index 784c92eaded8..1180a0cb0110 100644 --- a/net/core/sock.c +++ b/net/core/sock.c @@ -1377,9 +1377,9 @@ set_sndbuf: 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) |