pkgsrc-Bugs archive

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

pkg/58234: devel/libuv: uv_tcp_close_reset() needs to handle some additional errno on NetBSD



>Number:         58234
>Category:       pkg
>Synopsis:       devel/libuv: uv_tcp_close_reset() needs to handle some additional errno on NetBSD
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed May 08 11:35:00 +0000 2024
>Originator:     Yoshitaka Aharen
>Release:        pkgsrc-2024Q1
>Organization:
>Environment:
NetBSD i-07c93585682bdf6ff.ap-northeast-1.compute.internal 9.3_STABLE NetBSD 9.3_STABLE (GENERIC64) #0: Sat Apr  1 16:28:55 UTC 2023  mkrepro%mkrepro.NetBSD.org@localhost:/usr/src/sys/arch/evbarm/compile/GENERIC64 evbarm
>Description:
uv_tcp_close_reset() needs to handle some additional errno other than EINVAL on NetBSD.

https://github.com/libuv/libuv/blob/v1.48.0/src/unix/tcp.c#L399-L408

uv_tcp_close_reset() sets SO_LINGER then call uv_close().
If errno set in setsockopt() is EINVAL, it is converted to 0 then uv_close() is called.

While the man page tells different from the implementation, setsockopt() on NetBSD can return the other errno's which is better to be ignored in some situations (ECONNRESET, etc).  It is not the case in other operating systems.

A caller of uv_tcp_close_reset() needs to check the return value and call uv_close() by hand if it encounters such errno's.  As EINVAL (the socket has been shut down already) is handled explicitly, it would be better to also handle ECONNRESET (the socket has been reset by the remote) or such soft-failures gracefully.
>How-To-Repeat:

>Fix:


Home | Main Index | Thread Index | Old Index