Snapshot openvpn-2.x-20110909-master-install.exe fails
Current snapshot openvpn-2.x-20110909-master-install.exe. openvpngui fails with "no entry inet_ntop found in ws2_32.dll library' on windows xp
Quoted 4 lines
Current snapshot openvpn-2.x-20110909-master-install.exe. openvpngui fails with "no entry
inet_ntopfound in ws2_32.dll library' on windows xp
Hmm, this one rings a bell - I recall it having caused compile-time errors, too. I'll try to reproduce it a.s.a.p.
Krashan: how can I reproduce this? Is trying to connect to an OpenVPN server enough?
Signature · 5 lines
Samuli Seppänen Community Manager OpenVPN Technologies, Inc irc freenode net: mattock
Quoted 5 lines
Hmm, this one rings a bell - I recall it having caused compile-time errors, too. I'll try to reproduce it a.s.a.p.
Krashan: how can I reproduce this? Is trying to connect to an OpenVPN server enough?
I installed this package and start openvpnggui only. It doesn't start at all.
Quoted 5 lines · On Tuesday 20 September 2011 10:35:33 Krashan Brahmanjara wrote:
Quoted 2 lines
Krashan: how can I reproduce this? Is trying to connect to an OpenVPN server enough?
I installed this package and start openvpnggui only. It doesn't start at all.
The GUI runs openvpn during startup to get version information. That's where the error occurs. ws2_32.dll on Windows XP doesn't have inet_pton and inet_ntop. However, openvpn has its own version of these functions on Windows. I wonder why the linker is looking for it in the dll? I assume it has something to do with the import library on the build system overriding the symbols or maybe it's just that _MSC_VER was not defined. Samuli could you investigate?
Heiko
Signature · 8 lines
Heiko Hund | Software Engineer | Phone +49-721-25516-237 | Fax -200 Astaro a Sophos Company | Amalienbadstr. 41 Bau 52 | 76227 Karlsruhe | Germany Commercial Register: Mannheim HRA 702710 | Headquarter Location: Karlsruhe Represented by the General Partner Astaro Verwaltungs GmbH Amalienbadstraße 41 Bau 52 | 76227 Karlsruhe | Germany Commercial Register: Mannheim HRB 708248 | Executive Board: Gert Hansen, Markus Hennig, Jan Hichert, Günter Junk, Dr. Frank Nellissen
Quoted 1 line · On Tuesday 20 September 2011 12:28:30 Heiko Hund wrote:
or maybe it's just that
_MSC_VERwas not defined
Misread the code, it's an #ifndef. Could someone test if replacing the
#ifndef _MSC_VER
lines in socket.c and win32.h with
#if WINVER < 0x0600
leads to a problem when building with MSVC.
Heiko
Signature · 8 lines
Heiko Hund | Software Engineer | Phone +49-721-25516-237 | Fax -200 Astaro a Sophos Company | Amalienbadstr. 41 Bau 52 | 76227 Karlsruhe | Germany Commercial Register: Mannheim HRA 702710 | Headquarter Location: Karlsruhe Represented by the General Partner Astaro Verwaltungs GmbH Amalienbadstraße 41 Bau 52 | 76227 Karlsruhe | Germany Commercial Register: Mannheim HRB 708248 | Executive Board: Gert Hansen, Markus Hennig, Jan Hichert, Günter Junk, Dr. Frank Nellissen
Quoted 7 lines · On Tuesday 20 September 2011 12:28:30 Heiko Hund wrote:
Quoted 1 line
or maybe it's just that
_MSC_VERwas not definedMisread the code, it's an #ifndef. Could someone test if replacing the
#ifndef _MSC_VER
Quoted 7 lines
lines in
socket.candwin32.hwith#if WINVER < 0x0600leads to a problem when building with MSVC.
Heiko
I'll test and report back later today.
Signature · 5 lines
Samuli Seppänen Community Manager OpenVPN Technologies, Inc irc freenode net: mattock
Il 26/09/2011 09:46, Samuli Seppänen ha scritto:
Quoted 6 lines
Quoted 6 lines · On Tuesday 20 September 2011 12:28:30 Heiko Hund wrote:
Quoted 1 line
or maybe it's just that
_MSC_VERwas not definedMisread the code, it's an #ifndef. Could someone test if replacing the
#ifndef _MSC_VER
Quoted 9 lines
Quoted 7 lines
lines in
socket.candwin32.hwith#if WINVER < 0x0600leads to a problem when building with MSVC.
Heiko
I'll test and report back later today.
Ok, did as suggested for socket.c and win32.h and got the following build failure using MSVC:
<http://pastebin.com/xZ8J2yrq>
Signature · 5 lines
Samuli Seppänen Community Manager OpenVPN Technologies, Inc irc freenode net: mattock
Quoted 4 lines · On Monday 26 September 2011 14:13:30 Samuli Seppänen wrote:
Ok, did as suggested for
socket.candwin32.hand got the following build failure using MSVC:
---8<------------------------------------------------------------------ c:\users\samuli\openvpn-build\openvpn\win32.h(282) :
error C2373: 'inet_ntop' : redefinition; different type modifiers ---8<------------------------------------------------------------------
This is hopefully just because MSVC still believes it's building for Vista or later. Does the message disappear if you include syshead.h in win32.h? In there WINVER is already defined to signal building for XP. If that doesn't help, you should also check in <Ws2tcpip.h> if the declaration of inet_ntop is #ifdef'd taking WINVER into account.
Heiko
Signature · 8 lines
Heiko Hund | Software Engineer | Phone +49-721-25516-237 | Fax -200 Astaro a Sophos Company | Amalienbadstr. 41 Bau 52 | 76227 Karlsruhe | Germany Commercial Register: Mannheim HRA 702710 | Headquarter Location: Karlsruhe Represented by the General Partner Astaro Verwaltungs GmbH Amalienbadstraße 41 Bau 52 | 76227 Karlsruhe | Germany Commercial Register: Mannheim HRB 708248 | Executive Board: Gert Hansen, Markus Hennig, Jan Hichert, Günter Junk, Dr. Frank Nellissen
Il 26/09/2011 15:37, Heiko Hund ha scritto:
Quoted 10 lines · On Monday 26 September 2011 14:13:30 Samuli Seppänen wrote:
Quoted 4 lines
Ok, did as suggested for
socket.candwin32.hand got the following build failure using MSVC:---8<------------------------------------------------------------------ c:\users\samuli\openvpn-build\openvpn\win32.h(282) :
error C2373: 'inet_ntop' : redefinition; different type modifiers ---8<------------------------------------------------------------------
Quoted 7 lines
This is hopefully just because MSVC still believes it's building for Vista or later. Does the message disappear if you include
syshead.hinwin32.h? In there WINVER is already defined to signal building for XP. If that doesn't help, you should also check in <Ws2tcpip.h> if the declaration ofinet_ntopis #ifdef'd taking WINVER into account.Heiko
Hi Heiko,
Took a while, but I finally managed to debug the WinXP inet_ntop issue somewhat. The results are here:
<https://community.openvpn.net/openvpn/ticket/169>
In a nutshell, OpenVPN builds ok, but does not launch. Did not look into <Ws2tcpip.h> yet.
Signature · 5 lines
Samuli Seppänen Community Manager OpenVPN Technologies, Inc irc freenode net: mattock
Hi,
Quoted 10 lines · Samuli Seppänen
Il 26/09/2011 15:37, Heiko Hund ha scritto:
Quoted 9 lines · On Monday 26 September 2011 14:13:30 Samuli Seppänen wrote:
Quoted 4 lines
Ok, did as suggested for
socket.candwin32.hand got the following build failure using MSVC:---8<------------------------------------------------------------------ c:\users\samuli\openvpn-build\openvpn\win32.h(282) :
error C2373: 'inet_ntop' : redefinition; different type modifiers ---8<------------------------------------------------------------------
after discussions with Samuli and Heiko, I propose to solve this in a different way, namely "always use our own version of inet_ntop/inet_pton, and do not even try to keep the prototypes right on windows".
That is, I #define inet_ntop() to openvpn_inet_ntop() and inet_pton() to openvpn_inet_pton(), and thus change all the function calls to call our own function on "#ifdef WIN32" builds.
Trying to keep the function names and playing with prototypes didn't lead anywhere, and trying to play with the NTDDI_VERSION defines is far beyond the level of detail I want to know about Windows building.
So here's the patch - it compiles (MSVC on Win7), the resulting binary works on WinXP, and it's not too ugly - actually it removes more #ifdef's that it adds...
Let me know your comments.
gert
Signature · 4 lines
USENET is *not* the non-clickable part of WWW!
//www.muc.de/~gert/
Gert Doering - Munich, Germany [email protected]...
fax: +49-89-35655025 [email protected]...From 853662a6d1f5ad90e8d73032cea137541f6194e2 Mon Sep 17 00:00:00 2001
From: Gert Doering <[email protected]...>
Date: Thu, 24 Nov 2011 19:48:27 +0100
Subject: [PATCH] work around inet_ntop/inet_pton problems for MSVC builds on
WinXP
always use our built-in replacement functions now, even if building on Win7 (which has inet_ntop/inet_pton in the system libraries) because the resulting binary will then fail on WinXP.
--- socket.c | 3 --- win32.h | 10 ++++++---- 2 files changed, 6 insertions(+), 7 deletions(-)
socket.c +0 -3
@@ -3085,7 +3085,6 @@ link_socket_write_udp_posix_sendmsg (struct link_socket *sock,* WSAAddressToString() and WSAStringToAddress() functions */ -#ifndef _MSC_VERconst char *inet_ntop (int af,const void *src,char *dst,socklen_t size) {
@@ -3134,8 +3133,6 @@ inet_pton(int af, const char *src, void *dst)return 0 ; } -#endif -int socket_recv_queue (struct link_socket *sock,int maxsize) {
win32.h +6 -4
@@ -278,10 +278,12 @@ char *get_win_sys_path (void);/* call self in a subprocess */ void fork_to_self (const char *cmdline); -#ifndef _MSC_VER -const char *inet_ntop (int af,const void *src,char *dst,socklen_t size); -int inet_pton (int af,const char *src,void *st); -#endif + +const char *openvpn_inet_ntop (int af,const void *src, +char *dst,socklen_t size); +int openvpn_inet_pton (int af,const char *src,void *dst); +#define inet_ntop (af,src,dst,size) openvpn_inet_ntop(af,src,dst,size) +#define inet_pton (af,src,dst) openvpn_inet_pton(af,src,dst)/* Find temporary directory */ const char *win_get_tempdir ();
Signature · 1 line
1.7.4.4
Hi,
Quoted 5 lines · Gert Doering
So here's the patch - it compiles (MSVC on Win7), the resulting binary works on WinXP, and it's not too ugly - actually it removes more #ifdef's that it adds...
Let me know your comments.
So David found it confusing, and I agree to some extend :-) - it's easier to see what is happening if we declare our replacement functions as openvpn_inet_ntop() and openvpn_inet_pton() right away, instead of having the preprocessor #define rename them on the fly.
new patch.
gert
Signature · 4 lines
USENET is *not* the non-clickable part of WWW!
//www.muc.de/~gert/
Gert Doering - Munich, Germany [email protected]...
fax: +49-89-35655025 [email protected]...From 0d49be3449e86365364378f48393e5e2b75a1045 Mon Sep 17 00:00:00 2001
From: Gert Doering <[email protected]...>
Date: Thu, 24 Nov 2011 21:09:36 +0100
Subject: [PATCH] work around inet_ntop/inet_pton problems for MSVC builds on
WinXP
always use our built-in replacement functions now, even if building on Win7 (which has inet_ntop/inet_pton in the system libraries) because the resulting binary will then fail on WinXP.
--- socket.c | 9 ++++----- win32.h | 10 ++++++---- 2 files changed, 10 insertions(+), 9 deletions(-)
socket.c +4 -5
@@ -3083,11 +3083,12 @@ link_socket_write_udp_posix_sendmsg (struct link_socket *sock,/* * inet_ntop() and inet_pton() wrap-implementations using * WSAAddressToString() and WSAStringToAddress() functions +* +* this is needed as long as we support running OpenVPN on WinXP */ -#ifndef _MSC_VERconst char * -inet_ntop (int af,const void *src,char *dst,socklen_t size) +openvpn_inet_ntop (int af,const void *src,char *dst,socklen_t size) {struct sockaddr_storage ss;unsigned long s = size;
@@ -3111,7 +3112,7 @@ inet_ntop(int af, const void *src, char *dst, socklen_t size) }int -inet_pton (int af,const char *src,void *dst) +openvpn_inet_pton (int af,const char *src,void *dst) {struct sockaddr_storage ss;int size =sizeof (ss);
@@ -3134,8 +3135,6 @@ inet_pton(int af, const char *src, void *dst)return 0 ; } -#endif -int socket_recv_queue (struct link_socket *sock,int maxsize) {
win32.h +6 -4
@@ -278,10 +278,12 @@ char *get_win_sys_path (void);/* call self in a subprocess */ void fork_to_self (const char *cmdline); -#ifndef _MSC_VER -const char *inet_ntop (int af,const void *src,char *dst,socklen_t size); -int inet_pton (int af,const char *src,void *st); -#endif + +const char *openvpn_inet_ntop (int af,const void *src, +char *dst,socklen_t size); +int openvpn_inet_pton (int af,const char *src,void *dst); +#define inet_ntop (af,src,dst,size) openvpn_inet_ntop(af,src,dst,size) +#define inet_pton (af,src,dst) openvpn_inet_pton(af,src,dst)/* Find temporary directory */ const char *win_get_tempdir ();
Signature · 1 line
1.7.4.4
David Sommerseth
Acked-by-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Quoted 7 lines · Gert Doering
Hi,
Quoted 4 lines · Gert Doering
So here's the patch - it compiles (MSVC on Win7), the resulting binary works on WinXP, and it's not too ugly - actually it removes more #ifdef's that it adds...
Quoted 8 lines
Quoted 1 line
Let me know your comments.
So David found it confusing, and I agree to some extend :-) - it's easier to see what is happening if we declare our replacement functions as
openvpn_inet_ntop()andopenvpn_inet_pton()right away, instead of having the preprocessor #define rename them on the fly.new patch.
ACK. Applied to master branch in -testing and -stable.
commit 53fb2c5c465ea97fccdc8be1823fff2616f08b50
Author: Gert Doering <[email protected]...> Date: Thu Nov 24 21:09:36 2011 +0100
work around inet_ntop/inet_pton problems for MSVC builds on WinXP
always use our built-in replacement functions now, even if building on Win7 (which has inet_ntop/inet_pton in the system libraries) because the resulting binary will then fail on WinXP.
kind regards,
David Sommerseth
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iEYEARECAAYFAk7PwpAACgkQDC186MBRfrrb9ACcCYMVyBpIJUwsF5SzdAUZurpU KJAAoKayma19gm4jwJgAykjkvXaZX0Tq
=L43N
-----END PGP SIGNATURE-----