If we are using static ports and cannot resolve a hostname, then see if the proc is on the local host. If so, then attempt to use a loopback interface to complete the connection. Only implemented for IPv4 because the if.c code has been so hashed I couldn't figure out how to do this cleanly for all cases.
This commit was SVN r23647.
Этот коммит содержится в:
родитель
3b572e14ce
Коммит
3b3cd67d07
@ -1430,11 +1430,39 @@ int mca_oob_tcp_resolve(mca_oob_tcp_peer_t* peer)
|
|||||||
/* lookup the address of this node */
|
/* lookup the address of this node */
|
||||||
if (NULL == (h = gethostbyname(host))) {
|
if (NULL == (h = gethostbyname(host))) {
|
||||||
/* this isn't an error - it just means we don't know
|
/* this isn't an error - it just means we don't know
|
||||||
* how to compute a contact info for this proc
|
* how to compute a contact info for this proc.
|
||||||
|
* if we are trying to talk to a process on our own node, try
|
||||||
|
* looking for the loopback interface before giving up
|
||||||
*/
|
*/
|
||||||
|
#if OPAL_WANT_IPV6
|
||||||
goto unlock;
|
goto unlock;
|
||||||
}
|
}
|
||||||
haddr = inet_ntoa(*(struct in_addr*)h->h_addr_list[0]);
|
#else
|
||||||
|
if (0 == strcasecmp(host, orte_process_info.nodename) ||
|
||||||
|
0 == strncasecmp(host, orte_process_info.nodename, strlen(host)) ||
|
||||||
|
opal_ifislocal(host)) {
|
||||||
|
int idx;
|
||||||
|
struct sockaddr addr;
|
||||||
|
struct in_addr inaddr;
|
||||||
|
for (idx = opal_ifbegin(); 0 < idx; idx = opal_ifnext(idx)) {
|
||||||
|
if (opal_ifisloopback(idx)) {
|
||||||
|
if (OPAL_SUCCESS != (rc = opal_ifindextoaddr(idx, &addr, sizeof(addr)))) {
|
||||||
|
ORTE_ERROR_LOG(rc);
|
||||||
|
goto unlock;
|
||||||
|
}
|
||||||
|
inaddr = ((struct sockaddr_in*)(&addr))->sin_addr;
|
||||||
|
haddr = inet_ntoa(inaddr);
|
||||||
|
goto proceed;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
herror("COULD NOT COMPUTE CONTACT INFO");
|
||||||
|
goto unlock;
|
||||||
|
} else {
|
||||||
|
haddr = inet_ntoa(*(struct in_addr*)h->h_addr_list[0]);
|
||||||
|
}
|
||||||
|
proceed:
|
||||||
|
#endif
|
||||||
/* we can't know which af_family we are using, so for now, let's
|
/* we can't know which af_family we are using, so for now, let's
|
||||||
* just look to see which static port family was provided
|
* just look to see which static port family was provided
|
||||||
*/
|
*/
|
||||||
@ -1451,6 +1479,7 @@ int mca_oob_tcp_resolve(mca_oob_tcp_peer_t* peer)
|
|||||||
/* this isn't an error - it just means we don't know
|
/* this isn't an error - it just means we don't know
|
||||||
* how to compute a contact info for this proc
|
* how to compute a contact info for this proc
|
||||||
*/
|
*/
|
||||||
|
opal_output(0, "COULD NOT GET NODE RANK");
|
||||||
rc = ORTE_ERR_ADDRESSEE_UNKNOWN;
|
rc = ORTE_ERR_ADDRESSEE_UNKNOWN;
|
||||||
goto unlock;
|
goto unlock;
|
||||||
}
|
}
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user