The correct errno can get overwritten by the call to
format_extended_socket_error() which may set errno to EAGAIN
losing the original error and cause to bypass the error reporting
below. Fix by reading the errno of interest at the top of the
function.
Reported by: Gert Doering <gert@greenie.muc.de>
Signed-off-by: Selva Nair <selva.nair@gmail.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <
20220722204007.7537-1-selva.nair@gmail.com>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg24728.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
{
const char *extended_msg = NULL;
+ bool crt_error = false;
+ int my_errno = openvpn_errno_maybe_crt(&crt_error);
+
msg(x_cs_verbose_level, "%s %s returned %d",
sock ? proto2ascii(sock->info.proto, sock->info.af, true) : "",
description,
}
#endif
- bool crt_error = false;
- int my_errno = openvpn_errno_maybe_crt(&crt_error);
-
if (!ignore_sys_error(my_errno, crt_error))
{
if (extended_msg)