Skip to contentSkip to conversation

Does --multihome work in latest OpenVPN release?

Openvpn-devel David Sommerseth 3 participants 6 messages Jul 19, 2010 – Sep 23, 2010 4 messages not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]...

A message that is not in the archive (sent off-list or not yet received): [email protected]...

A message that is not in the archive (sent off-list or not yet received): [email protected]...

A message that is not in the archive (sent off-list or not yet received): [email protected]...

#4 lore raw

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 58 lines · Arthur Titeica
Quoted 35 lines · On Sunday 02 May 2010 02:34:47 Peter Rabbitson wrote:
Quoted 34 lines · David Sommerseth
Quoted 33 lines · Peter Rabbitson
Quoted 9 lines · Peter Rabbitson
Quoted 8 lines · Peter Rabbitson
Quoted 6 lines · Samuli Seppänen

Hi,

Is someone successfully using the --multihome option on latest OpenVPN release? Or is this bug report still valid:

<http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=562099>

Quoted 8 lines
Quoted 2 lines

I am sorry I dropped the ball on testing that one. Will test the coming night EST, and update.

Looking more at the *debian* changelog, I see that there was a 3rd party ipv6 patch, which *could* have caused these problems. However it is not very easy for me to compile a "clean" openvpn on the multihomed server. Please let me know if this can be diagnosed in any other way, if not - I will find a way to test with vanilla openvpn.

And unfortunately I was right (proven with the help of [1]) :(

openvpn_2.1~rc20-1_i386.deb works
openvpn_2.1~rc20-2_i386.deb does not

The only code-change between the two is:
* patches/jjo-ipv6-support.patch: Added ipv6 support. (Closes:
#307846)

Patch from JuanJo Ciarlante.

So this got to be the culprit. Attaching a -U10 diff between the sources of both debian packages (not too long):

Quoted 8 lines
Quoted 7 lines
Quoted 1 line

[1] http://snapshot.debian.org/package/openvpn/

Thank you very much, Peter, for tracking this one down! One question though. Do you have configuration files and a "how to test it" description available which you could share with us? That would help others to test it out as well - and it might help JJO to follow this one further.

Hello,
I'm using the latest git
(git://openvpn.git.sourceforge.net/gitroot/openvpn/openvpn-testing.git) and multihome doesn't seems to work as far as I've tested.

I have 2 links balanced with something like

# ip route show
...
default 
        nexthop via x.x.x.x  dev eth2 weight 2
        nexthop via y.y.y.y  dev ppp5 weight 1
Quoted 5 lines

and openvpn somehow fails with or without multihome.

I'm not a programmer but I'dd gladly help with anything else (making tests, patches or even providing a test multihomed openvpn server).

(moving over to the developers mailing list)

Thank you for your testing! If you put together some configuration files for client and server and a clear description of how to test this, that would save a lot of time for us when digging into the code.

If your config files makes use of certificates, please make your test environment work by using the keys in the source tree, located in the sample-keys/ directory.

Please try to make the config files for us as close to your setup as possible. This will really help us get closer to understand what exactly happens.

I have opened a bug ticket on this issue, to not forget this issue. It can be tracked here:
<https://community.openvpn.net/openvpn/ticket/28>

Please report back with configuration files and a description of how to prepare an environment for reproducing this behaviour.

kind regards,

David Sommerseth
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/

iEYEARECAAYFAkxE0OsACgkQDC186MBRfro0eACgmjjPpSObOVHp/5TRIUHD2B/+ 1QkAnirsODWvxsJo29MZSSqeX23/yzZf
=zbIE
-----END PGP SIGNATURE-----

#5 lore raw
Quoted 79 lines · On Tuesday 20 July 2010 01:25:47 David Sommerseth wrote:
Quoted 56 lines · Arthur Titeica
Quoted 36 lines · On Sunday 02 May 2010 02:34:47 Peter Rabbitson wrote:
Quoted 35 lines · David Sommerseth
Quoted 34 lines · Peter Rabbitson
Quoted 12 lines · Peter Rabbitson
Quoted 10 lines · Peter Rabbitson
Quoted 6 lines · Samuli Seppänen

Hi,

Is someone successfully using the --multihome option on latest OpenVPN release? Or is this bug report still valid:

<http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=562099>

I am sorry I dropped the ball on testing that one. Will test the coming night EST, and update.

Quoted 6 lines

Looking more at the *debian* changelog, I see that there was a 3rd party ipv6 patch, which *could* have caused these problems. However it is not very easy for me to compile a "clean" openvpn on the multihomed server. Please let me know if this can be diagnosed in any other way, if not - I will find a way to test with vanilla openvpn.

And unfortunately I was right (proven with the help of [1]) :(

openvpn_2.1~rc20-1_i386.deb works
openvpn_2.1~rc20-2_i386.deb does not

The only code-change between the two is:
* patches/jjo-ipv6-support.patch: Added ipv6 support. (Closes:
#307846)

Patch from JuanJo Ciarlante.

So this got to be the culprit. Attaching a -U10 diff between the sources of both debian packages (not too long):

Quoted 7 lines
Quoted 7 lines
Quoted 1 line

[1] http://snapshot.debian.org/package/openvpn/

Thank you very much, Peter, for tracking this one down! One question though. Do you have configuration files and a "how to test it" description available which you could share with us? That would help others to test it out as well - and it might help JJO to follow this one further.

Hello,
I'm using the latest git
(git://openvpn.git.sourceforge.net/gitroot/openvpn/openvpn-testing.git)
and multihome doesn't seems to work as far as I've tested.

I have 2 links balanced with something like

# ip route show
...
default
Quoted 7 lines

nexthop via x.x.x.x dev eth2 weight 2
nexthop via y.y.y.y dev ppp5 weight 1

and openvpn somehow fails with or without multihome.

I'm not a programmer but I'dd gladly help with anything else (making tests, patches or even providing a test multihomed openvpn server).

(moving over to the developers mailing list)

Thank you for your testing! If you put together some configuration files for client and server and a clear description of how to test this, that would save a lot of time for us when digging into the code.

If your config files makes use of certificates, please make your test environment work by using the keys in the source tree, located in the sample-keys/ directory.

Please try to make the config files for us as close to your setup as possible. This will really help us get closer to understand what exactly happens.

Quoted 8 lines

I have opened a bug ticket on this issue, to not forget this issue. It can be tracked here:
<https://community.openvpn.net/openvpn/ticket/28>

Please report back with configuration files and a description of how to prepare an environment for reproducing this behaviour.

Hello,
I've managed to setup a test dual-homed server with the following configs:

server: http://psw.ro/tmp/test-server.conf
client: http://psw.ro/tmp/test-client.conf

With verb 6 on the client after successfully connecting thru one of the links
- connecting thru the second link hangs for a period of ~10 minutes with the following log:

client-log1: http://psw.ro/tmp/client-log1.log

If needed I'll try to find some time to better describe my network setup.

Thanks.

Signature · 2 lines
Arthur Titeica
PharmEc Software Constanta
#6 lore raw

Hi Arthur,

Sorry for the immense delay, fortunately David ping()ed me on this issue a few days ago.

Quoted 95 lines · Arthur Titeica
Quoted 79 lines · On Tuesday 20 July 2010 01:25:47 David Sommerseth wrote:
Quoted 56 lines · Arthur Titeica
Quoted 36 lines · On Sunday 02 May 2010 02:34:47 Peter Rabbitson wrote:
Quoted 35 lines · David Sommerseth
Quoted 34 lines · Peter Rabbitson
Quoted 12 lines · Peter Rabbitson
Quoted 10 lines · Peter Rabbitson
Quoted 6 lines · Samuli Seppänen

Hi,

Is someone successfully using the --multihome option on latest OpenVPN release? Or is this bug report still valid:

<http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=562099>

I am sorry I dropped the ball on testing that one. Will test the coming night EST, and update.

Quoted 6 lines

Looking more at the *debian* changelog, I see that there was a 3rd party ipv6 patch, which *could* have caused these problems. However it is not very easy for me to compile a "clean" openvpn on the multihomed server. Please let me know if this can be diagnosed in any other way, if not - I will find a way to test with vanilla openvpn.

And unfortunately I was right (proven with the help of [1]) :(

openvpn_2.1~rc20-1_i386.deb works
openvpn_2.1~rc20-2_i386.deb does not

The only code-change between the two is:
  * patches/jjo-ipv6-support.patch: Added ipv6 support. (Closes:
  #307846)

    Patch from JuanJo Ciarlante.

So this got to be the culprit. Attaching a -U10 diff between the sources of both debian packages (not too long):

Quoted 7 lines
Quoted 7 lines
Quoted 1 line

[1] http://snapshot.debian.org/package/openvpn/

Thank you very much, Peter, for tracking this one down!  One question though.  Do you have configuration files and a "how to test it" description available which you could share with us?  That would help others to test it out as well - and it might help JJO to follow this one further.

Hello,
I'm using the latest git
(git://openvpn.git.sourceforge.net/gitroot/openvpn/openvpn-testing.git)
and multihome doesn't seems to work as far as I've tested.

I have 2 links balanced with something like

# ip route show
...
default
Quoted 7 lines

        nexthop via x.x.x.x  dev eth2 weight 2
        nexthop via y.y.y.y  dev ppp5 weight 1

and openvpn somehow fails with or without multihome.

I'm not a programmer but I'dd gladly help with anything else (making tests, patches or even providing a test multihomed openvpn server).

(moving over to the developers mailing list)

Thank you for your testing!  If you put together some configuration files for client and server and a clear description of how to test this, that would save a lot of time for us when digging into the code.

If your config files makes use of certificates, please make your test environment work by using the keys in the source tree, located in the sample-keys/ directory.

Please try to make the config files for us as close to your setup as possible.  This will really help us get closer to understand what exactly happens.

Quoted 8 lines

I have opened a bug ticket on this issue, to not forget this issue.  It can be tracked here:
<https://community.openvpn.net/openvpn/ticket/28>

Please report back with configuration files and a description of how to prepare an environment for reproducing this behaviour.

Hello,
I've managed to setup a test dual-homed server with the following configs:

server: http://psw.ro/tmp/test-server.conf
client: http://psw.ro/tmp/test-client.conf

Quoted 7 lines

With verb 6 on the client after successfully connecting thru one of the links
-  connecting thru the second link hangs for a period of ~10 minutes with the following log:

client-log1: http://psw.ro/tmp/client-log1.log

If needed I'll try to find some time to better describe my network setup.

I think I fixed it, is there a chance you could try recompiling openvpn with the attached patch ?

Cheers!,

Quoted 17 lines

Thanks.

--
Arthur Titeica
PharmEc Software Constanta

------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone? Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
Openvpn-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel

Signature · 1 line
--JuanJo ; echo [email protected]... | sed 's/[SPAM]//g'

From 1b96baa8fc964bfba8bfba87f1e0e1fbabf0b47b Mon Sep 17 00:00:00 2001
From: JuanJo Ciarlante <[email protected]>
Date: Thu, 23 Sep 2010 01:15:35 +0200
Subject: [PATCH] * fix --multihome for ipv4: cmsg_len must compare against in_pktinfo
size, not the full 4+6 union, also use saner variable names.

---
 socket.c |   27 ++++++++++++++-------------
 1 files changed, 14 insertions(+), 13 deletions(-)
socket.c +14 -13
index 288b58a..810bb23 100644
@@ -2436,6 +2436,7 @@ print_link_socket_actual_ex (const struct link_socket_actual *act,
 		{
 		  struct openvpn_sockaddr sa;
 		  CLEAR (sa);
+		  sa.addr.in4.sin_family = AF_INET;
 		  sa.addr.in4.sin_addr = act->pi.in4.ipi_spec_dst;
 		  buf_printf (&out, " (via %s)", print_sockaddr_ex (&sa, separator, 0, gc));
 		}
@@ -2779,7 +2780,7 @@ link_socket_read_tcp (struct link_socket *sock,
 struct openvpn_in4_pktinfo
 {
   struct cmsghdr cmsghdr;
-  struct in_pktinfo pi;
+  struct in_pktinfo pi4;
 };
 #ifdef USE_PF_INET6
 struct openvpn_in6_pktinfo
@@ -2790,9 +2791,9 @@ struct openvpn_in6_pktinfo
 #endif
 
 union openvpn_pktinfo {
-	struct openvpn_in4_pktinfo cmsgpi;
+	struct openvpn_in4_pktinfo msgpi4;
 #ifdef USE_PF_INET6
-	struct openvpn_in6_pktinfo cmsgpi6;
+	struct openvpn_in6_pktinfo msgpi6;
 #endif
 };
 #pragma pack()
@@ -2815,7 +2816,7 @@ link_socket_read_udp_posix_recvmsg (struct link_socket *sock,
   mesg.msg_name = &from->dest.addr;
   mesg.msg_namelen = fromlen;
   mesg.msg_control = &opi;
-  mesg.msg_controllen = sizeof (opi);
+  mesg.msg_controllen = sizeof opi;
   buf->len = recvmsg (sock->sd, &mesg, 0);
   if (buf->len >= 0)
     {
@@ -2826,7 +2827,7 @@ link_socket_read_udp_posix_recvmsg (struct link_socket *sock,
 	  && CMSG_NXTHDR (&mesg, cmsg) == NULL
 	  && cmsg->cmsg_level == SOL_IP 
 	  && cmsg->cmsg_type == IP_PKTINFO
-	  && cmsg->cmsg_len >= sizeof (opi))
+	  && cmsg->cmsg_len >= sizeof (struct openvpn_in4_pktinfo))
 	{
 	  struct in_pktinfo *pkti = (struct in_pktinfo *) CMSG_DATA (cmsg);
 	  from->pi.in4.ipi_ifindex = pkti->ipi_ifindex;
@@ -2914,15 +2915,15 @@ link_socket_write_udp_posix_sendmsg (struct link_socket *sock,
     {
     case AF_INET:
       {
-        struct openvpn_in4_pktinfo opi;
+        struct openvpn_in4_pktinfo msgpi4;
         struct in_pktinfo *pkti;
         mesg.msg_name = &to->dest.addr.sa;
         mesg.msg_namelen = sizeof (struct sockaddr_in);
-        mesg.msg_control = &opi;
-        mesg.msg_controllen = sizeof (opi);
+        mesg.msg_control = &msgpi4;
+        mesg.msg_controllen = sizeof msgpi4;
         mesg.msg_flags = 0;
         cmsg = CMSG_FIRSTHDR (&mesg);
-        cmsg->cmsg_len = sizeof (opi);
+        cmsg->cmsg_len = sizeof (struct openvpn_in4_pktinfo);
         cmsg->cmsg_level = SOL_IP;
         cmsg->cmsg_type = IP_PKTINFO;
         pkti = (struct in_pktinfo *) CMSG_DATA (cmsg);
@@ -2934,15 +2935,15 @@ link_socket_write_udp_posix_sendmsg (struct link_socket *sock,
 #ifdef USE_PF_INET6
     case AF_INET6:
       {
-        struct openvpn_in6_pktinfo opi6;
+        struct openvpn_in6_pktinfo msgpi6;
         struct in6_pktinfo *pkti6;
         mesg.msg_name = &to->dest.addr.sa;
         mesg.msg_namelen = sizeof (struct sockaddr_in6);
-        mesg.msg_control = &opi6;
-        mesg.msg_controllen = sizeof (opi6);
+        mesg.msg_control = &msgpi6;
+        mesg.msg_controllen = sizeof msgpi6;
         mesg.msg_flags = 0;
         cmsg = CMSG_FIRSTHDR (&mesg);
-        cmsg->cmsg_len = sizeof (opi6);
+        cmsg->cmsg_len = sizeof (struct openvpn_in6_pktinfo);
         cmsg->cmsg_level = IPPROTO_IPV6;
         cmsg->cmsg_type = IPV6_PKTINFO;
         pkti6 = (struct in6_pktinfo *) CMSG_DATA (cmsg);
Signature · 1 line
1.7.1
#7 lore raw
Quoted 4 lines · JuanJo Ciarlante

Hi Arthur,

Sorry for the immense delay, fortunately David ping()ed me on this issue a few days ago.

Hi. Better later than never.

Quoted 3 lines

I think I fixed it, is there a chance you could try recompiling openvpn with the attached patch ?

Will do that in the course of the day. Many thanks.

#8 lore raw
Quoted 8 lines · On Thursday 23 September 2010 07:48:46 Arthur Titeica wrote:

On Thu, 23 Sep 2010 01:33:24 +0200, JuanJo Ciarlante

Quoted 4 lines · <[email protected]...> wrote:

Hi Arthur,

Sorry for the immense delay, fortunately David ping()ed me on this issue a few days ago.

Quoted 7 lines

Hi. Better later than never.

Quoted 3 lines

I think I fixed it, is there a chance you could try recompiling openvpn
with the attached patch ?

Will do that in the course of the day. Many thanks.

Well, it looks OK so far after 3-4 hours of running.

Signature · 5 lines
Arthur Titeica
PharmEc Software Constanta
Mobil: 0729 290 969
Tel: 0241 616 747
Fax: 0341 815 963
#9 lore raw
Quoted 11 lines · Arthur Titeica
Quoted 10 lines · On Thursday 23 September 2010 07:48:46 Arthur Titeica wrote:

 On Thu, 23 Sep 2010 01:33:24 +0200, JuanJo Ciarlante

Quoted 4 lines · <[email protected]...> wrote:

Hi Arthur,

Sorry for the immense delay, fortunately David ping()ed me on this issue a few days ago.

 Hi. Better later than never.

Quoted 7 lines
Quoted 5 lines
Quoted 3 lines

I think I fixed it, is there a chance you could try recompiling openvpn
with the attached patch ?

 Will do that in the course of the day. Many thanks.

Well, it looks OK so far after 3-4 hours of running.

WooHoohoo ... sweET!, thanks for the prompt feedback :)

I'll do a bit of more testing, then ask for the upstream pull.

Cheers,

Quoted 8 lines

--
Arthur Titeica
PharmEc Software Constanta
Mobil: 0729 290 969
Tel: 0241 616 747
Fax: 0341 815 963

Signature · 1 line
--JuanJo ; echo [email protected]... | sed 's/[SPAM]//g'