From 5765ecc22ef9e49d0179255dd02e3bc59a418177 Mon Sep 17 00:00:00 2001 From: Adrian Knoth Date: Sun, 29 Apr 2007 16:23:11 +0000 Subject: [PATCH] This patch reverts r14549 while retaining IPv6 support. Re #1008 This commit was SVN r14550. The following SVN revision numbers were found above: r14549 --> open-mpi/ompi@386baed55bdf0a78ba84c582ac636fd360eb95b4 --- ompi/mca/btl/tcp/btl_tcp_proc.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/ompi/mca/btl/tcp/btl_tcp_proc.c b/ompi/mca/btl/tcp/btl_tcp_proc.c index bbdeaf0e56..9a768be683 100644 --- a/ompi/mca/btl/tcp/btl_tcp_proc.c +++ b/ompi/mca/btl/tcp/btl_tcp_proc.c @@ -327,6 +327,30 @@ bool mca_btl_tcp_proc_accept(mca_btl_tcp_proc_t* btl_proc, struct sockaddr* addr OPAL_THREAD_LOCK(&btl_proc->proc_lock); for( i = 0; i < btl_proc->proc_endpoint_count; i++ ) { mca_btl_base_endpoint_t* btl_endpoint = btl_proc->proc_endpoints[i]; + /* Check all conditions before going to try to accept the connection. */ + if( btl_endpoint->endpoint_addr->addr_family != addr->sa_family ) { + continue; + } + + switch (addr->sa_family) { + case AF_INET: + if( memcmp( &btl_endpoint->endpoint_addr->addr_inet, + &(((struct sockaddr_in*)addr)->sin_addr), + sizeof(struct in_addr) ) ) { + continue; + } + break; + case AF_INET6: + if( memcmp( &btl_endpoint->endpoint_addr->addr_inet, + &(((struct sockaddr_in6*)addr)->sin6_addr), + sizeof(struct in6_addr) ) ) { + continue; + } + break; + default: + ; + } + if(mca_btl_tcp_endpoint_accept(btl_endpoint, addr, sd)) { OPAL_THREAD_UNLOCK(&btl_proc->proc_lock); return true;