Re-enable support for local addresses.
This patch is based on the "RFC: Reenabling the TCP BTL over local interfaces (when specifically requested)". It removes the hardcoded exception for the local devices that has been enforced by the TCP BTL. Instead, we exclude the local interface only via the exclude MCA (both IPv4 and IPv6 local addresses are already in the default if_exclude), which is also the behavior currently described in our README file.
Этот коммит содержится в:
родитель
362a5886de
Коммит
93fa94f96f
@ -552,18 +552,7 @@ int mca_btl_tcp_proc_insert( mca_btl_tcp_proc_t* btl_proc,
|
||||
if(NULL != proc_data->local_interfaces[i]->ipv4_address &&
|
||||
NULL != peer_interfaces[j]->ipv4_address) {
|
||||
|
||||
/* check for loopback */
|
||||
if ((opal_net_islocalhost((struct sockaddr *)local_interface->ipv4_address) &&
|
||||
!opal_net_islocalhost((struct sockaddr *)peer_interfaces[j]->ipv4_address)) ||
|
||||
(opal_net_islocalhost((struct sockaddr *)peer_interfaces[j]->ipv4_address) &&
|
||||
!opal_net_islocalhost((struct sockaddr *)local_interface->ipv4_address)) ||
|
||||
(opal_net_islocalhost((struct sockaddr *)local_interface->ipv4_address) &&
|
||||
!opal_ifislocal(proc_hostname))) {
|
||||
|
||||
/* No connection is possible on these interfaces */
|
||||
|
||||
/* check for RFC1918 */
|
||||
} else if(opal_net_addr_isipv4public((struct sockaddr*) local_interface->ipv4_address) &&
|
||||
if(opal_net_addr_isipv4public((struct sockaddr*) local_interface->ipv4_address) &&
|
||||
opal_net_addr_isipv4public((struct sockaddr*) peer_interfaces[j]->ipv4_address)) {
|
||||
if(opal_net_samenetwork((struct sockaddr*) local_interface->ipv4_address,
|
||||
(struct sockaddr*) peer_interfaces[j]->ipv4_address,
|
||||
@ -574,7 +563,7 @@ int mca_btl_tcp_proc_insert( mca_btl_tcp_proc_t* btl_proc,
|
||||
}
|
||||
proc_data->best_addr[i][j] = peer_interfaces[j]->ipv4_endpoint_addr;
|
||||
continue;
|
||||
} else {
|
||||
}
|
||||
if(opal_net_samenetwork((struct sockaddr*) local_interface->ipv4_address,
|
||||
(struct sockaddr*) peer_interfaces[j]->ipv4_address,
|
||||
local_interface->ipv4_netmask)) {
|
||||
@ -585,7 +574,6 @@ int mca_btl_tcp_proc_insert( mca_btl_tcp_proc_t* btl_proc,
|
||||
proc_data->best_addr[i][j] = peer_interfaces[j]->ipv4_endpoint_addr;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
/* check state of ipv6 address pair - ipv6 is always public,
|
||||
* since link-local addresses are skipped in opal_ifinit()
|
||||
@ -593,17 +581,7 @@ int mca_btl_tcp_proc_insert( mca_btl_tcp_proc_t* btl_proc,
|
||||
if(NULL != local_interface->ipv6_address &&
|
||||
NULL != peer_interfaces[j]->ipv6_address) {
|
||||
|
||||
/* check for loopback */
|
||||
if ((opal_net_islocalhost((struct sockaddr *)local_interface->ipv6_address) &&
|
||||
!opal_net_islocalhost((struct sockaddr *)peer_interfaces[j]->ipv6_address)) ||
|
||||
(opal_net_islocalhost((struct sockaddr *)peer_interfaces[j]->ipv6_address) &&
|
||||
!opal_net_islocalhost((struct sockaddr *)local_interface->ipv6_address)) ||
|
||||
(opal_net_islocalhost((struct sockaddr *)local_interface->ipv6_address) &&
|
||||
!opal_ifislocal(proc_hostname))) {
|
||||
|
||||
/* No connection is possible on these interfaces */
|
||||
|
||||
} else if(opal_net_samenetwork((struct sockaddr*) local_interface->ipv6_address,
|
||||
if(opal_net_samenetwork((struct sockaddr*) local_interface->ipv6_address,
|
||||
(struct sockaddr*) peer_interfaces[j]->ipv6_address,
|
||||
local_interface->ipv6_netmask)) {
|
||||
proc_data->weights[i][j] = CQ_PUBLIC_SAME_NETWORK;
|
||||
@ -758,6 +736,7 @@ int mca_btl_tcp_proc_remove(mca_btl_tcp_proc_t* btl_proc, mca_btl_base_endpoint_
|
||||
mca_btl_tcp_proc_t* mca_btl_tcp_proc_lookup(const opal_process_name_t *name)
|
||||
{
|
||||
mca_btl_tcp_proc_t* proc = NULL;
|
||||
|
||||
OPAL_THREAD_LOCK(&mca_btl_tcp_component.tcp_lock);
|
||||
opal_proc_table_get_value(&mca_btl_tcp_component.tcp_procs,
|
||||
*name, (void**)&proc);
|
||||
@ -795,9 +774,8 @@ mca_btl_tcp_proc_t* mca_btl_tcp_proc_lookup(const opal_process_name_t *name)
|
||||
*/
|
||||
void mca_btl_tcp_proc_accept(mca_btl_tcp_proc_t* btl_proc, struct sockaddr* addr, int sd)
|
||||
{
|
||||
size_t i;
|
||||
OPAL_THREAD_LOCK(&btl_proc->proc_lock);
|
||||
for( i = 0; i < btl_proc->proc_endpoint_count; i++ ) {
|
||||
for( size_t 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 ) {
|
||||
|
Загрузка…
Ссылка в новой задаче
Block a user