From d2938a144f3a0129b30d1e92a7b10456a083f744 Mon Sep 17 00:00:00 2001 From: Ralph Castain Date: Mon, 12 Jan 2015 05:31:02 -0800 Subject: [PATCH] Use the proper interface index. Thanks to Mark Kettenis for spotting the problem and providing a patch --- orte/mca/oob/tcp/oob_tcp_component.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/orte/mca/oob/tcp/oob_tcp_component.c b/orte/mca/oob/tcp/oob_tcp_component.c index b4fccb810d..7057c387d0 100644 --- a/orte/mca/oob/tcp/oob_tcp_component.c +++ b/orte/mca/oob/tcp/oob_tcp_component.c @@ -1124,7 +1124,8 @@ static char **split_and_resolve(char **orig_str, char *name) argv_prefix); /* Go through all interfaces and see if we can find a match */ - for (if_index = 0; if_index < opal_ifcount(); if_index++) { + for (if_index = opal_ifbegin(); if_index >= 0; + if_index = opal_ifnext(if_index)) { opal_ifindextoaddr(if_index, (struct sockaddr*) &if_inaddr, sizeof(if_inaddr)); @@ -1136,7 +1137,7 @@ static char **split_and_resolve(char **orig_str, char *name) } /* If we didn't find a match, keep trying */ - if (if_index == opal_ifcount()) { + if (if_index < 0) { orte_show_help("help-oob-tcp.txt", "invalid if_inexclude", true, name, orte_process_info.nodename, tmp, "Did not find interface matching this subnet");