Hi,

On Mon, Nov 23, 2015 at 11:51:43AM +0000, Christian Pellegrin wrote:
> On Sat, Nov 21, 2015 at 8:06 PM, Gert Doering <g...@greenie.muc.de> wrote:
> >             if (sock->info.af == AF_UNSPEC)
> > +               {
> >                    msg (M_WARN, "Could not determine IPv4/IPv6 protocol. 
> > Using %s",
> >                      
> > addr_family_name(sock->info.lsa->bind_local->ai_family));
> > +                  sock->info.af = sock->info.lsa->bind_local->ai_family;
> > +               }
> 
> Just tested, I ack it works perfectly. Thanks!

Thanks.  So I've committed the patch as appended (slightly different
format than the "usual" process as the original patch was no formal 
commit yet, but message-id and ack etc. preserved)

gert

From ed5d0fe5097a26206a6a7d4463622461a0987655 Mon Sep 17 00:00:00 2001
From: Gert Doering <g...@greenie.muc.de>
List-Post: openvpn-devel@lists.sourceforge.net
Date: Mon, 23 Nov 2015 20:47:42 +0100
Subject: [PATCH] Fix info.af == AF_UNSPEC case for server with --mtu-disc

Commit 2bed089d31a12c2 introduced "AF_UNSPEC" sockets when we do not know
the actual address family yet - for the "bind local" case, getaddrinfo()
will tell us what to do, but that information never made it into
sock->info.af - so, make it.  Otherwise, trying to call --mtu-disc
on an OpenVPN server will cause a M_FATAL error in set_mtu_discovery())

Signed-off-by: Gert Doering <g...@greenie.muc.de>
Acked-by: Christian Pellegrin <chrip...@google.com>
Message-ID: <20151121200637.gd24...@greenie.muc.de>
URL: http://article.gmane.org/gmane.network.openvpn.devel/10547
---
 src/openvpn/socket.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/openvpn/socket.c b/src/openvpn/socket.c
index b24d9ad..8e6b4bc 100644
--- a/src/openvpn/socket.c
+++ b/src/openvpn/socket.c
@@ -1887,8 +1887,11 @@ link_socket_init_phase2 (struct link_socket *sock,
              /* Warn if this is because neither v4 or v6 was specified
               * and we should not connect a remote */
              if (sock->info.af == AF_UNSPEC)
-               msg (M_WARN, "Could not determine IPv4/IPv6 protocol. Using %s",
+               {
+                 msg (M_WARN, "Could not determine IPv4/IPv6 protocol. Using 
%s",
                     addr_family_name(sock->info.lsa->bind_local->ai_family));
+                 sock->info.af = sock->info.lsa->bind_local->ai_family;
+               }
 
              create_socket (sock, sock->info.lsa->bind_local);
            }
-- 
2.4.9


-- 
USENET is *not* the non-clickable part of WWW!
                                                           //www.muc.de/~gert/
Gert Doering - Munich, Germany                             g...@greenie.muc.de
fax: +49-89-35655025                        g...@net.informatik.tu-muenchen.de

Attachment: signature.asc
Description: PGP signature

Reply via email to