aboutsummaryrefslogtreecommitdiff
path: root/src/openvpn
diff options
context:
space:
mode:
Diffstat (limited to 'src/openvpn')
-rw-r--r--src/openvpn/options.c2
-rw-r--r--src/openvpn/socket.c22
-rw-r--r--src/openvpn/socket.h2
3 files changed, 14 insertions, 12 deletions
diff --git a/src/openvpn/options.c b/src/openvpn/options.c
index 2543ca5..809bfa0 100644
--- a/src/openvpn/options.c
+++ b/src/openvpn/options.c
@@ -2905,7 +2905,7 @@ options_string (const struct options *o,
buf_printf (&out, ",dev-type %s", dev_type_string (o->dev, o->dev_type));
buf_printf (&out, ",link-mtu %d", EXPANDED_SIZE (frame));
buf_printf (&out, ",tun-mtu %d", PAYLOAD_SIZE (frame));
- buf_printf (&out, ",proto %s", proto2ascii (proto_remote (o->ce.proto, remote),o->ce.af, true));
+ buf_printf (&out, ",proto %s", proto_remote (o->ce.proto, remote));
/* send tun_ipv6 only in peer2peer mode - in client/server mode, it
* is usually pushed by the server, triggering a non-helpful warning
diff --git a/src/openvpn/socket.c b/src/openvpn/socket.c
index f0e0914..1117e30 100644
--- a/src/openvpn/socket.c
+++ b/src/openvpn/socket.c
@@ -2599,19 +2599,21 @@ addr_family_name (int af)
* has always sent UDPv4, TCPv4 over the wire. Keep these
* strings for backward compatbility
*/
-int
+const char*
proto_remote (int proto, bool remote)
{
ASSERT (proto >= 0 && proto < PROTO_N);
- if (remote)
- {
- switch (proto)
- {
- case PROTO_TCP_SERVER: return PROTO_TCP_CLIENT;
- case PROTO_TCP_CLIENT: return PROTO_TCP_SERVER;
- }
- }
- return proto;
+ if (proto == PROTO_UDP)
+ return "UDPv4";
+
+ if ( (remote && proto == PROTO_TCP_CLIENT) ||
+ (!remote && proto == PROTO_TCP_SERVER))
+ return "TCPv4_SERVER";
+ if ( (remote && proto == PROTO_TCP_SERVER) ||
+ (!remote && proto == PROTO_TCP_CLIENT))
+ return "TCPv4_CLIENT";
+
+ ASSERT (0);
}
/*
diff --git a/src/openvpn/socket.h b/src/openvpn/socket.h
index 223c70d..a41a3d9 100644
--- a/src/openvpn/socket.h
+++ b/src/openvpn/socket.h
@@ -532,7 +532,7 @@ int ascii2proto (const char* proto_name);
sa_family_t ascii2af (const char* proto_name);
const char *proto2ascii (int proto, sa_family_t af, bool display_form);
const char *proto2ascii_all (struct gc_arena *gc);
-int proto_remote (int proto, bool remote);
+const char *proto_remote (int proto, bool remote);
const char *addr_family_name(int af);
/*