summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJuanJo Ciarlante <jjo@google.com>2009-10-01 00:15:12 +0200
committerJuanJo Ciarlante <juanjosec@gmail.com>2011-03-25 13:30:29 +0100
commitaa8e9576bbd2ecd094276521ad9cf88227a119c9 (patch)
treefa0f00f699e8527a8d71ba8b01719f48b2676edd
parentead3784086e76add44d53b0ffa87e3a8bd3fa8c7 (diff)
downloadopenvpn-aa8e9576bbd2ecd094276521ad9cf88227a119c9.tar.gz
openvpn-aa8e9576bbd2ecd094276521ad9cf88227a119c9.tar.xz
openvpn-aa8e9576bbd2ecd094276521ad9cf88227a119c9.zip
* fix multi-tcp crash (corrected assertion)
-rw-r--r--mtcp.c6
-rw-r--r--socket.c6
2 files changed, 10 insertions, 2 deletions
diff --git a/mtcp.c b/mtcp.c
index f8cc50f..ade2cfb 100644
--- a/mtcp.c
+++ b/mtcp.c
@@ -150,7 +150,11 @@ multi_tcp_instance_specific_init (struct multi_context *m, struct multi_instance
ASSERT (mi->context.c2.link_socket);
ASSERT (mi->context.c2.link_socket->info.lsa);
ASSERT (mi->context.c2.link_socket->mode == LS_MODE_TCP_ACCEPT_FROM);
- ASSERT (mi->context.c2.link_socket->info.lsa->actual.dest.addr.sa.sa_family == AF_INET);
+ ASSERT (mi->context.c2.link_socket->info.lsa->actual.dest.addr.sa.sa_family == AF_INET
+#ifdef USE_PF_INET6
+ || mi->context.c2.link_socket->info.lsa->actual.dest.addr.sa.sa_family == AF_INET6
+#endif
+ );
if (!mroute_extract_openvpn_sockaddr (&mi->real, &mi->context.c2.link_socket->info.lsa->actual.dest, true))
{
msg (D_MULTI_ERRORS, "MULTI TCP: TCP client address is undefined");
diff --git a/socket.c b/socket.c
index 96d2602..2bb7141 100644
--- a/socket.c
+++ b/socket.c
@@ -1645,7 +1645,11 @@ link_socket_init_phase1 (struct link_socket *sock,
if (mode == LS_MODE_TCP_ACCEPT_FROM)
{
ASSERT (accept_from);
- ASSERT (sock->info.proto == PROTO_TCPv4_SERVER);
+ ASSERT (sock->info.proto == PROTO_TCPv4_SERVER
+#ifdef USE_PF_INET6
+ || sock->info.proto == PROTO_TCPv6_SERVER
+#endif
+ );
ASSERT (!sock->inetd);
sock->sd = accept_from->sd;
}