diff options
author | Arne Schwabe <arne@rfc2549.org> | 2012-12-04 20:42:54 +0100 |
---|---|---|
committer | David Sommerseth <davids@redhat.com> | 2012-12-13 16:46:01 +0100 |
commit | 34bc52d611deec62e7fe56622771b58921d52176 (patch) | |
tree | 097266fc4f979b3c76c28db21dcf4d0355959073 /src | |
parent | e99982218b5549894a94cc3c5f6209219d911ba1 (diff) | |
download | openvpn-34bc52d611deec62e7fe56622771b58921d52176.tar.gz openvpn-34bc52d611deec62e7fe56622771b58921d52176.tar.xz openvpn-34bc52d611deec62e7fe56622771b58921d52176.zip |
Fix the proto is used inconsistently warning
Fix the "WARNING: 'proto' is used inconsistently, local='proto UDP',
remote='proto UDPv6'." message.
Note that the on wire strings are now always TCPv4 and UDPv4 to be
compatible to pre2.3
Signed-off-by: Arne Schwabe <arne@rfc2549.org>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: 1354650174-25601-1-git-send-email-arne@rfc2549.org
URL: http://article.gmane.org/gmane.network.openvpn.devel/7175
Signed-off-by: David Sommerseth <davids@redhat.com>
(cherry picked from commit 38727e09df35245ba0cfe335e23e6b43c817ce58)
Diffstat (limited to 'src')
-rw-r--r-- | src/openvpn/socket.c | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/src/openvpn/socket.c b/src/openvpn/socket.c index 21a4b2b..8eb112b 100644 --- a/src/openvpn/socket.c +++ b/src/openvpn/socket.c @@ -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; |