summaryrefslogtreecommitdiff
path: root/src/openvpn/socket.c
diff options
context:
space:
mode:
authorAlberto Gonzalez Iniesta <agi@inittab.org>2013-01-10 17:54:05 +0100
committerAlberto Gonzalez Iniesta <agi@inittab.org>2013-01-10 17:54:05 +0100
commit0159f6a3459c511c94b009afd0bfe5dc8e8991d1 (patch)
tree3c12297fd9b61426d6873c3c821360ef71e01448 /src/openvpn/socket.c
parentc0bce9e49cf1fbeda1269e93d9818e4861725e71 (diff)
parent9e3cceecfca10ef806f193ec41e0e0a44706c328 (diff)
Merge tag 'upstream/2.3.0'
Upstream version 2.3.0
Diffstat (limited to 'src/openvpn/socket.c')
-rw-r--r--src/openvpn/socket.c24
1 files changed, 19 insertions, 5 deletions
diff --git a/src/openvpn/socket.c b/src/openvpn/socket.c
index 505cf3b..8eb112b 100644
--- a/src/openvpn/socket.c
+++ b/src/openvpn/socket.c
@@ -158,7 +158,7 @@ openvpn_getaddrinfo (unsigned int flags,
CLEAR(hints);
hints.ai_family = ai_family;
hints.ai_flags = AI_NUMERICHOST;
- hints.ai_socktype = dnsflags_to_socktype(flags);
+ hints.ai_socktype = SOCK_STREAM;
status = getaddrinfo(hostname, NULL, &hints, res);
@@ -2560,6 +2560,10 @@ addr_family_name (int af)
*
* This is used for options compatibility
* checking.
+ *
+ * IPv6 and IPv4 protocols are comptabile but OpenVPN
+ * has always sent UDPv4, TCPv4 over the wire. Keep these
+ * strings for backward compatbility
*/
int
proto_remote (int proto, bool remote)
@@ -2569,10 +2573,20 @@ proto_remote (int proto, bool remote)
{
switch (proto)
{
- case PROTO_TCPv4_SERVER: return PROTO_TCPv4_CLIENT;
- case PROTO_TCPv4_CLIENT: return PROTO_TCPv4_SERVER;
- case PROTO_TCPv6_SERVER: return PROTO_TCPv6_CLIENT;
- case PROTO_TCPv6_CLIENT: return PROTO_TCPv6_SERVER;
+ case PROTO_TCPv4_SERVER: return PROTO_TCPv4_CLIENT;
+ case PROTO_TCPv4_CLIENT: return PROTO_TCPv4_SERVER;
+ case PROTO_TCPv6_SERVER: return PROTO_TCPv4_CLIENT;
+ case PROTO_TCPv6_CLIENT: return PROTO_TCPv4_SERVER;
+ case PROTO_UDPv6: return PROTO_UDPv4;
+ }
+ }
+ else
+ {
+ switch (proto)
+ {
+ case PROTO_TCPv6_SERVER: return PROTO_TCPv4_SERVER;
+ case PROTO_TCPv6_CLIENT: return PROTO_TCPv4_CLIENT;
+ case PROTO_UDPv6: return PROTO_UDPv4;
}
}
return proto;