Hi,

On Tue, May 03, 2022 at 03:28:40AM +0300, Lev Stipakov wrote:
> From: Lev Stipakov <l...@openvpn.net>
> 
> We use M_ERRNO flag in logging to display error code
> and error message. This has been broken on Windows,
> where we use error code from GetLastError() and
> error description from strerror(). strerror() expects
> C runtime error code, which is quite different from
> last error code from WinAPI call. As a result, we got
> incorrect error description.

This patch breaks extended socket error reporting.

In the git tree, we have those two right next to each other

commit 54800aa975418fe3570f3206a5f9b277dc59bd47
Author: Lev Stipakov <l...@openvpn.net>
Date:   Tue May 3 03:28:40 2022 +0300

    Fix M_ERRNO behavior on Windows

 -> broken

commit 043c67f36342969cd171d24c70ee6b62ebc95fee
Author: Gert Doering <g...@greenie.muc.de>
Date:   Tue Feb 22 15:35:14 2022 +0100

    Implement --mtu-disc for IPv6 UDP sockets.

 -> works


Testing is easy: point openvpn on a Linux system(!) to an unreachable
destination (--verb 5 used here, but 3 should be sufficient)).

With 043c67f, this gives

2022-07-22 18:07:59 us=599924 UDPv6 link remote: 
[AF_INET6]2001:608:2:a::253:1196
W2022-07-22 18:07:59 us=628976 read UDPv6 [ECONNREFUSED]: Connection refused 
(fd=3,code=111)
W2022-07-22 18:08:02 us=168862 read UDPv6 [ECONNREFUSED]: Connection refused 
(fd=3,code=111)
W2022-07-22 18:08:07 us=228896 read UDPv6 [ECONNREFUSED]: Connection refused 
(fd=3,code=111)

with 54800aa9754, this becomes

2022-07-22 18:14:16 us=271797 UDPv6 link remote: 
[AF_INET6]2001:608:2:a::253:1196
WWWWW^C2022-07-22 18:14:46 us=706438 event_wait : Interrupted system call 
(fd=-1,code=4)

("nothing nothing nothing ctrl-c")


I can see that the patch at least touches code close to it...

+#endif /* EXTENDED_SOCKET_ERROR_CAPABILITY */

... so it would be nice if someone could have a look what this patch
is trampling on that it shouldn't...

gert
-- 
"If was one thing all people took for granted, was conviction that if you 
 feed honest figures into a computer, honest figures come out. Never doubted 
 it myself till I met a computer with a sense of humor."
                             Robert A. Heinlein, The Moon is a Harsh Mistress

Gert Doering - Munich, Germany                             g...@greenie.muc.de

Attachment: signature.asc
Description: PGP signature

_______________________________________________
Openvpn-devel mailing list
Openvpn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-devel

Reply via email to