1
1

Added new oob-tcp parameter oob_tcp_disable_family.

Like btl_tcp_disable_family, this parameter more or less disables
a whole address family. Though the sockets are still created, the
corresponding information isn't added to the connection strings.

Likewise, we don't try to connect to addresses matching the disabled
address family.

This is particularly important for multidomain clusters, where IPv4 is
oftenly filtered (firewalled), sometimes by simply dropping the packets
instead of rejecting them (thus causing a connection timeout instead of
a quick "no route to host").

This commit was SVN r18163.
Этот коммит содержится в:
Adrian Knoth 2008-04-16 09:22:00 +00:00
родитель 75c54616c7
Коммит 0ddfff4ffe
3 изменённых файлов: 22 добавлений и 2 удалений

Просмотреть файл

@ -368,6 +368,11 @@ int mca_oob_tcp_component_open(void)
false, false,
64*1024 - 1 - mca_oob_tcp_component.tcp6_port_min,
&mca_oob_tcp_component.tcp6_port_range);
mca_base_param_reg_int(&mca_oob_tcp_component.super.oob_base,
"disable_family", "Disable IPv4 (4) or IPv6 (6)",
false, false,
0,
&mca_oob_tcp_component.disable_family);
mca_oob_tcp_component.tcp6_listen_sd = -1;
#endif /* OPAL_WANT_IPV6 */
@ -1462,12 +1467,14 @@ char* mca_oob_tcp_get_addr(void)
ptr += sprintf(ptr, ";");
}
if (dev->if_addr.ss_family == AF_INET) {
if (dev->if_addr.ss_family == AF_INET &&
4 != mca_oob_tcp_component.disable_family) {
ptr += sprintf(ptr, "tcp://%s:%d", opal_net_get_hostname((struct sockaddr*) &dev->if_addr),
ntohs(mca_oob_tcp_component.tcp_listen_port));
}
#if OPAL_WANT_IPV6
if (dev->if_addr.ss_family == AF_INET6) {
if (dev->if_addr.ss_family == AF_INET6 &&
6 != mca_oob_tcp_component.disable_family) {
ptr += sprintf(ptr, "tcp6://%s:%d", opal_net_get_hostname((struct sockaddr*) &dev->if_addr),
ntohs(mca_oob_tcp_component.tcp6_listen_port));
}

Просмотреть файл

@ -211,6 +211,7 @@ struct mca_oob_tcp_component_t {
unsigned short tcp6_listen_port; /**< IPv6 listen port */
int tcp6_port_min; /**< Minimum allowed port for the OOB listen socket */
int tcp6_port_range; /**< Range of allowed TCP ports */
int disable_family; /**< disable AF: 0-nothing, 4-IPv4, 6-IPv6 */
#endif /* OPAL_WANT_IPV6 */
opal_mutex_t tcp_lock; /**< lock for accessing module state */
opal_list_t tcp_events; /**< list of pending events (accepts) */

Просмотреть файл

@ -366,6 +366,18 @@ static int mca_oob_tcp_peer_try_connect(mca_oob_tcp_peer_t* peer)
return ORTE_ERR_UNREACH;
}
/* we have IPv4 disabled, so obey it and don't try to connect */
if (AF_INET == inaddr.ss_family &&
4 == mca_oob_tcp_component.disable_family) {
continue;
}
/* we have IPv6 disabled, so obey it and don't try to connect */
if (AF_INET6 == inaddr.ss_family &&
6 == mca_oob_tcp_component.disable_family) {
continue;
}
if(mca_oob_tcp_component.tcp_debug >= OOB_TCP_DEBUG_CONNECT) {
opal_output(0, "%s-%s mca_oob_tcp_peer_try_connect: "
"connecting port %d to: %s:%d\n",