NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

kern/58241: setsockopt() sets undocumented errno



>Number:         58241
>Category:       kern
>Synopsis:       setsockopt() sets undocumented errno
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          doc-bug
>Submitter-Id:   net
>Arrival-Date:   Fri May 10 06:20:00 +0000 2024
>Originator:     Yoshitaka Aharen
>Release:        NetBSD 10.0
>Organization:
>Environment:
NetBSD i-060b5c885a3a2d13a.ap-northeast-1.compute.internal 10.0 NetBSD 10.0 (GENERIC64) #0: Thu Mar 28 08:33:33 UTC 2024  mkrepro%mkrepro.NetBSD.org@localhost:/usr/src/sys/arch/evbarm/compile/GENERIC64 evbarm
>Description:
setsockopt() sets undocumented errno in some cases.

According to ERRORS section the man page of setsockopt(2), it can be read that the possible errno are: EBADF/EFAULT/EINVAL/ENOPROTOOPT/ENOTSOCK.
However, if the connection has been reset when calling setsockopt() with SOL_SOCKET level or IPPROTO_TCP level, errno is set to ECONNRESET.

It would be better to either:
  (1) update the man page
    or
  (2) change the kernel behavior to the same as the man page (Note: FreeBSD/OpenBSD/Linux doesn't set such errno)
>How-To-Repeat:

>Fix:



Home | Main Index | Thread Index | Old Index