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 <gert@greenie.muc.de>
Acked-by: Christian Pellegrin <chripell@google.com>
Message-ID: <
20151121200637.GD24952@greenie.muc.de>
URL: http://article.gmane.org/gmane.network.openvpn.devel/10547
/* 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);
}